Package org.apache.roller.weblogger.business

Examples of org.apache.roller.weblogger.business.UserManager.checkPermission()


                            && !theAction.requiredWeblogPermissionActions().isEmpty()) {                       
                        WeblogPermission required = new WeblogPermission(
                                actionWeblog, 
                                theAction.requiredWeblogPermissionActions());
                       
                        if (!umgr.checkPermission(required, authenticatedUser)) {
                            log.debug("DENIED: user does not have required weblog permissions = "+required);
                            return "access-denied";
                        }
                    }
                }
View Full Code Here


            try {
                boolean hasAdmin = false;
                UserManager mgr = WebloggerFactory.getWeblogger().getUserManager();
                GlobalPermission adminPerm =
                    new GlobalPermission(Collections.singletonList(GlobalPermission.ADMIN));
                if (mgr.checkPermission(adminPerm, getUser())) {
                    hasAdmin = true;
               
               
                // grant/revoke admin role if needed
                if (hasAdmin && !getBean().isAdministrator()) {
View Full Code Here

    public boolean isUserIsAdmin() {
        try {
            GlobalPermission adminPerm = new GlobalPermission(
                Collections.singletonList(GlobalPermission.ADMIN));
            UserManager umgr = WebloggerFactory.getWeblogger().getUserManager();
            return umgr.checkPermission(adminPerm, getAuthenticatedUser());
        } catch (Exception e) {}
        return false;
    }
   
   
View Full Code Here

    public boolean hasUserPermissions(User user, List<String> actions) {
        try {
            // look for user in website's permissions
            UserManager umgr = WebloggerFactory.getWeblogger().getUserManager();
            WeblogPermission userPerms = new WeblogPermission(this, user, actions);
            return umgr.checkPermission(userPerms, user);
           
        } catch (WebloggerException ex) {
            // something is going seriously wrong, not much we can do here
            log.error("ERROR checking user permssion", ex);
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.