Package at.riemers.zero.base.model

Examples of at.riemers.zero.base.model.Permission


          Role role = roleDao.getRole("admin");
          if (role == null) {
              log.info("admin role not found...");
              role = new Role();
              role.setName("admin");
              role.addPermission(new Permission(AUTH_USER, "*", true));
              role.addPermission(new Permission(AUTH_USER_EDIT, "", false));
              role.addPermission(new Permission(AUTH_ROLE_EDIT, "", false));
              role.addPermission(new Permission(AUTH_FUNCTION_LOG, "", false));
              role.addPermission(new Permission(AUTH_CURRENT_USERS, "", false));
              role.addPermission(new Permission(AUTH_USER_CHANGE_PWD, "", false));
              log.info("creating admin role...");
              roleDao.makePersistent(role);
          }
          admin.addRole(role);
         
View Full Code Here


                for (String key : selected.getSelected().keySet()) {
                    log.info("key: " + key);
                    PermissionTemplate permissionTemplate = getModuleManager().getPermissionTemplate(key);

                    if (permissionTemplate != null) {
                        Permission permission = permissionTemplate.createPermission();
                        permissions.add(permission);
                    } else {
                        log.warn("permission not found");
                    }
                }
View Full Code Here

            }


            boolean error = false;
            for (String permissionKey : roleForm.getValues().keySet()) {
                Permission permission = role.getPermission(permissionKey);
                if (permission != null) {
                    PermissionTemplate permissionTemplate = getModuleManager().getPermissionTemplate(permissionKey);
                    if (permissionTemplate != null) {
                        String value = roleForm.getValues().get(permissionKey);
                        if (permissionTemplate.isValuePermission()) {
                            if (permissionTemplate.checkValue(value)) {
                                permission.setValue(value);
                            } else {
                                if (permissionTemplate.getValueRangeMessage() != null) {
                                    view.setMessage(permissionTemplate.getValueRangeMessage());
                                    error = true;
                                }
View Full Code Here

        for (Role role : user.getRoles()) {
            for(Permission permission : role.getPermissions()) {               
                gas.add(new SpringGrantedAuthority(permission));               
            }
        }
        gas.add(new SpringGrantedAuthority(new Permission("ROLE_USER", "")));
               
        return gas;
    }
View Full Code Here

                row = row + userListComponent.getPage() * userListComponent.getRowsPerPage();
                log.debug(row);
                ZeroUser selectedUser = ((DefaultTableModel<ZeroUser>) userListComponent.getModel()).get(row);
                if (selectedUser != null) {
                    if (!user.checkAuthorisation(
                            new Permission(UserModule.AUTH_USER, selectedUser.getUserGroup().getGroupKey()),
                            new Permission(UserModule.AUTH_USER_EDIT, "", false))) {
                        view.setMessage(new Message("zero.message.user.delete_no_permission", Message.MSG_ERROR, selectedUser.getUsername()));
                        return new ModelAndView(view, null);
                    }
                } else {
                    log.debug("username not found");
View Full Code Here

                int row = Integer.parseInt(selectedRow);
                row = row + userListComponent.getPage() * userListComponent.getRowsPerPage();
                ZeroUser selectedUser = ((DefaultTableModel<ZeroUser>) userListComponent.getModel()).get(row);
                if (selectedUser != null) {
                    if (!user.checkAuthorisation(
                            new Permission(UserModule.AUTH_USER, selectedUser.getUserGroup().getGroupKey()),
                            new Permission(UserModule.AUTH_USER_EDIT, "", false))) {
                        view.setMessage(new Message("zero.message.user.delete_no_permission", Message.MSG_ERROR, selectedUser.getUsername()));
                        return new ModelAndView(view, null);
                    }
                } else {
                    log.debug("username not found");
View Full Code Here

                int row = Integer.parseInt(selectedRow);
                row = row + userListComponent.getPage() * userListComponent.getRowsPerPage();
                ZeroUser selectedUser = ((DefaultTableModel<ZeroUser>) userListComponent.getModel()).get(row);
                if (selectedUser != null) {
                    if (!user.checkAuthorisation(
                            new Permission(UserModule.AUTH_USER, selectedUser.getUserGroup().getGroupKey()),
                            new Permission(UserModule.AUTH_USER_EDIT, "", false))) {
                        view.setMessage(new Message("zero.message.user.edit_no_permission", Message.MSG_ERROR, selectedUser.getUsername()));
                        return new ModelAndView(view, null);
                    }
                } else {
                    log.debug("username not found");
View Full Code Here

                int row = Integer.parseInt(selectedRow);
                row = row + userListComponent.getPage() * userListComponent.getRowsPerPage();
                ZeroUser selectedUser = ((DefaultTableModel<ZeroUser>) userListComponent.getModel()).get(row);
                if (selectedUser != null) {
                    if (!user.checkAuthorisation(
                            new Permission(UserModule.AUTH_USER, selectedUser.getUserGroup().getGroupKey()),
                            new Permission(UserModule.AUTH_USER_EDIT, "", false))) {
                        view.setMessage(new Message("zero.message.user.edit_no_permission", Message.MSG_ERROR, selectedUser.getUsername()));
                        return new ModelAndView(view, null);
                    }
                } else {
                    log.debug("username not found");
View Full Code Here

                    log.debug("user == null");
                }

                if (selectedUser.getUserGroup() != null) {
                    if (!user.checkAuthorisation(
                            new Permission(UserModule.AUTH_USER, selectedUser.getUserGroup().getGroupKey()),
                            new Permission(UserModule.AUTH_USER_EDIT, "", false))) {
                        view.setMessage(new Message("zero.message.user.edit_no_permission", Message.MSG_ERROR, selectedUser.getUsername()));
                        return new ModelAndView(view, null);
                    }
                }
View Full Code Here

TOP

Related Classes of at.riemers.zero.base.model.Permission

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.