public class Permission extends Object implements Serializable
Constructor and Description |
---|
Permission()
Creates a permission where everyone can access the resource (public)
|
Permission(Membership membership)
Creates a permission where users with the specified membership can access the resource
|
Permission(Set<Membership> memberships)
Creates a permission where users with one or more of the specified memberships can access the resource
|
Permission(String membershipType,
Group group)
Creates a permission where users with the specified member type in the specified group can access the resource
|
Permission(User user)
Creates a permission where the the specified user can access the resource
|
Modifier and Type | Method and Description |
---|---|
Permission |
addMembership(Membership membership)
Creates a new permission that includes all memberships of this permission and the specified membership
|
static Permission |
any(String... group)
Returns a permission where users with any membership type in the specified group can access the resource
|
static Permission |
everyone()
Returns a permission where everyone can access the resource (public)
|
Set<Membership> |
getMemberships()
Returns all memberships with permissions to access the resource
|
boolean |
isAccessibleToEveryone()
Returns true if everyone has permissions to access the item
|
String |
toString() |
public Permission()
public Permission(String membershipType, Group group)
membershipType
- the membership typegroup
- the grouppublic Permission(User user)
user
- the userpublic Permission(Membership membership)
membership
- the membershippublic Permission(Set<Membership> memberships)
memberships
- the membershipspublic static Permission everyone()
public static Permission any(String... group)
group
- the grouppublic Set<Membership> getMemberships()
public Permission addMembership(Membership membership)
membership
- the membership to addpublic boolean isAccessibleToEveryone()
Copyright © 2013 JBoss by Red Hat. All Rights Reserved.