Package framework.security

Examples of framework.security.UserRightsGroup


    public void setRightsMask(int armID, Map<String, Integer> maskMap) throws ClipsServerException {
        Set<Integer> rightsId2Save = new HashSet<Integer>();//эти права будут сохранены
        int mask = 0;
        Enumeration<UserRightsGroup> e = rightsSet.rightsGroups();
        while (e.hasMoreElements()) {
            UserRightsGroup group = e.nextElement();
            mask = maskMap.get(group.getTitle());
            Iterator<UserRight> it = getRightsFromMask(group, mask).iterator();
            while (it.hasNext()) {
                UserRight ur = it.next();
                rightsId2Save.add(ur.getID());
            }
View Full Code Here


    @Override
    public void setValueAt(Object obj, int row, int col) {// изменение таблицы
        if(col == COLUMN_CHECKS){
            Boolean set = (Boolean) obj;
            UserRight r = rights.get(row);
            UserRightsGroup group = r.getGroup();
            int mask = maskMap.get(group);
            if(set){
                mask = mask | r.getRightsMask();
            }else{
                mask = excludeFromMask(r);
View Full Code Here

    @Override
    public void setValueAt(Object obj, int row, int col) {// изменение таблицы       
        if(col == COLUMN_CHECKS){
            Boolean set = (Boolean) obj;
            UserRight r = rights.get(row);
            UserRightsGroup group = r.getGroup();
            int mask = maskMap.get(group);
            if(set){
                mask = mask | r.getRightsMask();
            }else
                mask = excludeFromMask(r);
View Full Code Here

        errorMode = false;
        initComponents();

        Enumeration<UserRightsGroup> rightsGroups = rightsSet.rightsGroups();
        while (rightsGroups.hasMoreElements()) {
            UserRightsGroup urg = rightsGroups.nextElement();
            System.out.println("Group: " + urg);
            Set<UserRight> rights = urg.getRights();
            for (UserRight userRight : rights) {
                System.out.print("   right: " + userRight + " mask: " + userRight.getRightsMask());
                Set<UserRight> includes = new HashSet<UserRight>();
                for (UserRight ur : rights) {
                    if (!ur.equals(userRight) && UserRight.include(userRight.getRightsMask(), ur.getRightsMask())) {
                        includes.add(ur);
                    }
                }
                if (includes.isEmpty()){
                    System.out.println();
                }else{
                    System.out.println(" include:");
                    for (UserRight ur : includes) {
                        System.out.println("   - " + ur + " mask: " + ur.getRightsMask());
                    }
                }
            }
        }

        panelCollaboratorSelect1.setSelectedCollaborator(null);
        panelCollaboratorSelect1.addContentStateListener(new ContentStateListener() {

            @Override
            public void contentStateChanged() {
                setErrorMode(false);
                DirectoryCollaboratorItem selectedCollaborator = panelCollaboratorSelect1.getSelectedItem();
                if (selectedCollaborator == null) {
                    return;
                }
                if (collabLoc != null && collabLoc.isDirty() && selectedCollaborator.getID() != collabLoc.getID()) {
                    MessageBox.showWarning(MessageBox.W_NOT_CLOSE_EDITING);
                    try {
                        panelCollaboratorSelect1.setSelectedCollaborator(dirCollab.getItemFromID(collabLoc.getID()));
                    } catch (DirectoryItemNotFoundException ex) {
                        MessageBox.showException(ex);
                    }
                } else {
                    if (collabLoc != null && selectedCollaborator.getID() == collabLoc.getID()) {
                        return;
                    }
                    try {
                        spec.setText("");
                        collabLoc = new CollaboratorLocal(selectedCollaborator.getID(), getAuditManager());
                        collabLoc.getDetails();//костыль, иначе детали не прогрузятся
                        collabLoc.addContentStateListener(getContainer());

                        DefaultListModel model = new  DefaultListModel();
                        Enumeration<UserRightsGroup> enu = rightsSet.rightsGroups();
                        while(enu.hasMoreElements()) {
                            UserRightsGroup gr = enu.nextElement();
                            model.addElement(gr);
                        }
                        rightsGroup.setModel(model);

                        resetTable();
View Full Code Here

    /**
     * Обновление таблицы
     * @param cl
     */
    private void resetTable() throws ClipsException {
        UserRightsGroup gr = (UserRightsGroup) rightsGroup.getSelectedValue();
        if(gr == null) {
            tblUserRights.setModel(new TableModelUserRightsM());
        } else {
            tblUserRights.setModel(new TableModelUserRightsM(gr, collabLoc));
        }       
View Full Code Here

    public ModificationInfo setRightsMask(Map<String, Integer> maskMap) throws ClipsServerException {
        Set<Integer> rightsId2Save = new HashSet<Integer>();//эти права будут сохранены
        int mask = 0;
        Enumeration<UserRightsGroup> e = rightsSet.rightsGroups();
        while (e.hasMoreElements()) {
            UserRightsGroup group = e.nextElement();
            mask = maskMap.get(group.getTitle());
            Iterator<UserRight> it = getRightsFromMask(group, mask).iterator();
            while (it.hasNext()) {
                UserRight ur = it.next();
                rightsId2Save.add(ur.getID());
            }
View Full Code Here

TOP

Related Classes of framework.security.UserRightsGroup

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.