use of org.candlepin.auth.permissions.Permission in project candlepin by candlepin.
the class User method getPermissions.
/**
* Full list of permissions for this user.
*
* Includes those from roles stored in the database, as well as those explicitly added
* by the user service adapter.
*
* @return full list of permissions for this user.
*/
@XmlTransient
public Set<Permission> getPermissions() {
PermissionFactory permFactory = new PermissionFactory();
Set<Permission> perms = new HashSet<>();
for (Role r : getRoles()) {
perms.addAll(permFactory.createPermissions(this, r.getPermissions()));
}
perms.addAll(this.permissions);
return perms;
}
use of org.candlepin.auth.permissions.Permission in project candlepin by candlepin.
the class ConsumerResourceCreationTest method createConsumer.
protected ConsumerDTO createConsumer(String consumerName) {
Collection<Permission> perms = new HashSet<>();
perms.add(new OwnerPermission(owner, Access.ALL));
Principal principal = new UserPrincipal(USER, perms, false);
List<String> empty = Collections.emptyList();
return createConsumer(consumerName, principal, empty);
}
Aggregations