OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 93 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 93 Rev 156
Line 12... Line 12...
12
 */
12
 */
13
 
13
 
14
 package org.openconcerto.sql.users.rights;
14
 package org.openconcerto.sql.users.rights;
15
 
15
 
16
import static java.util.Arrays.asList;
16
import static java.util.Arrays.asList;
17
import org.openconcerto.sql.TM;
-
 
18
import org.openconcerto.sql.element.ConfSQLElement;
-
 
-
 
17
 
19
import org.openconcerto.sql.element.GlobalMapper;
18
import org.openconcerto.sql.element.GlobalMapper;
20
import org.openconcerto.sql.element.SQLComponent;
19
import org.openconcerto.sql.element.SQLComponent;
-
 
20
import org.openconcerto.sql.element.SQLElement;
21
import org.openconcerto.sql.model.DBRoot;
21
import org.openconcerto.sql.model.DBRoot;
22
import org.openconcerto.sql.model.SQLTable;
22
import org.openconcerto.sql.model.SQLTable;
23
import org.openconcerto.sql.utils.SQLCreateTable;
23
import org.openconcerto.sql.utils.SQLCreateTable;
24
import org.openconcerto.utils.i18n.I18nUtils;
-
 
25
 
24
 
26
import java.util.ArrayList;
25
import java.util.ArrayList;
27
import java.util.Collections;
26
import java.util.Collections;
28
import java.util.List;
27
import java.util.List;
29
import java.util.Set;
28
import java.util.Set;
30
 
29
 
31
public class UserRightSQLElement extends ConfSQLElement {
30
public class UserRightSQLElement extends SQLElement {
32
    public static final String TABLE_NAME = "USER_RIGHT";
31
    public static final String TABLE_NAME = "USER_RIGHT";
33
 
32
 
34
    static public List<SQLCreateTable> getCreateTables(final SQLTable userT) {
33
    static public List<SQLCreateTable> getCreateTables(final SQLTable userT) {
35
        final DBRoot root = userT.getDBRoot();
34
        final DBRoot root = userT.getDBRoot();
36
        final SQLTable t = root.findTable(TABLE_NAME, false);
35
        final SQLTable t = root.findTable(TABLE_NAME, false);
Line 54... Line 53...
54
        res.add(create);
53
        res.add(create);
55
 
54
 
56
        return res;
55
        return res;
57
    }
56
    }
58
 
57
 
59
    public UserRightSQLElement() {
58
    public UserRightSQLElement(final DBRoot r) {
60
        super(TABLE_NAME);
59
        super(r.findTable(TABLE_NAME), null, "sql.user-right");
61
        this.setL18nPackageName(I18nUtils.getPackageName(TM.class));
-
 
62
        final UserRightGroup group = new UserRightGroup();
60
        final UserRightGroup group = new UserRightGroup();
63
        GlobalMapper.getInstance().map(UserRightSQLComponent.ID, group);
61
        GlobalMapper.getInstance().map(UserRightSQLComponent.ID, group);
64
        setDefaultGroup(group);
62
        setDefaultGroup(group);
65
    }
63
    }
66
 
64