List of usage examples for org.apache.shiro.authz SimpleAuthorizationInfo addObjectPermissions
public void addObjectPermissions(Collection<Permission> permissions)
From source file:de.triology.blog.complexspermissions.ComplexPermissionRealm.java
License:Open Source License
@Override protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principalCollection) { SimpleAuthorizationInfo authorizationInfo = new SimpleAuthorizationInfo(); authorizationInfo.addObjectPermissions(createFilePermissions()); return authorizationInfo; }
From source file:org.sonatype.nexus.proxy.security.PlexusConfiguredRealm.java
License:Open Source License
@Override protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) { String username = (String) principals.iterator().next(); // check the userPrivilageMap key set for the user if (StringUtils.isNotEmpty(username) && this.userPrivileges.containsKey(username)) { SimpleAuthorizationInfo info = new SimpleAuthorizationInfo(); // "nexus:target:" + <targetId> + ":" + <repoId> + ":" + <action> // String priv = "nexus:target:" + "*" + ":" + "repo1" + ":" + "*"; info.addObjectPermissions(this.buildPermissions(this.userPrivileges.get(username))); return info; }/*from w w w.jav a 2 s .c o m*/ return null; }