public Collection < Permission > getAggregatePermissions ( ) { if ( aggregatePermissions == null ) { Set < Permission > perms = new LinkedHashSet <> ( ) ; perms . addAll ( permissions ) ; for ( Role role : roles ) { perms . addAll ( role . getPermissions ( ) ) ; } if ( perms . isEmpty ( ) ) { aggregatePermissions = Collections . emptySet ( ) ; } else { aggregatePermissions = Collections . unmodifiableSet ( perms ) ; } } return aggregatePermissions ; }
Gets the collection of permissions including the role permissions and discrete permissions .