Package org.apache.shiro.authz.permission

Examples of org.apache.shiro.authz.permission.AllPermission


        add(new SimpleAccount(
                username,
                password,
                getName(),
                CollectionUtils.asSet("root"),
                CollectionUtils.<Permission>asSet(new AllPermission())
        ));
    }
View Full Code Here


      throws Exception
  {
    ExceptionCatchingModularRealmAuthorizer subject =
        new ExceptionCatchingModularRealmAuthorizer(Collections.<Realm>singleton(BROKEN_REALM));

    Permission permission = new AllPermission();

    Assert.assertFalse(subject.isPermitted((PrincipalCollection) null, ""));
    Assert.assertFalse(subject.isPermitted((PrincipalCollection) null, permission));
    Assert.assertFalse(subject.isPermitted((PrincipalCollection) null, new String[]{""})[0]);
    Assert.assertFalse(subject.isPermitted((PrincipalCollection) null, Collections.singletonList(permission))[0]);
View Full Code Here

        ProjectAuthorityService projectAuthorityService = beanFactory.getBean(ProjectAuthorityService.class);
        //
        Project project = getProjectFromWebSubject();
        ProjectUser projectUser = getProjectUserFromWebSubject();
        if(project==null) {
            authorizationInfo.addObjectPermission(new AllPermission());
        } else if(project.getCreatedById()==projectUser.getId()) {// owner
            //
            List<ProjectAuthority> projectAuthorities = projectAuthorityService.listProjectAuthorities();
            for(ProjectAuthority projectAuthority : projectAuthorities) {
                //
                String authorityCode = projectAuthority.getCode();
                StringUtils.replace(authorityCode, "-", ":");
                authorizationInfo.addStringPermission(authorityCode.replaceAll("-", ":"));
            }
        } else {
            //
            authorizationInfo.addObjectPermission(new AllPermission());
        }
        //
        return authorizationInfo;
    }
View Full Code Here

TOP

Related Classes of org.apache.shiro.authz.permission.AllPermission

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.