code: public Permissions getEffective() {
  
          final ModeledAuthenticatedUser authenticatedUser = getCurrentUser();
          final Set<String> effectiveGroups;
  
          // If this user is the currently-authenticated user, include any
          // additional effective groups declared by the authentication system
          if (authenticatedUser.getIdentifier().equals(getIdentifier()))
              effectiveGroups = entityService.retrieveEffectiveGroups(this,
                      authenticatedUser.getEffectiveUserGroups());
  
          // Otherwise, just include effective groups from the database
          else
              effectiveGroups = getEffectiveUserGroups();
  
          // Return a permissions object which describes all effective
          // permissions, including any permissions inherited via user groups
          return new Permissions() {
  
              @Override
              public ObjectPermissionSet getActiveConnectionPermissions()
                      throws GuacamoleException {
                  return activeConnectionPermissionService.getPermissionSet(authenticatedUser, ModeledPermissions.this, effectiveGroups);
              }
  
              @Override
              public ObjectPermissionSet getConnectionGroupPermissions()
                      throws GuacamoleException {
                  return connectionGroupPermissionService.getPermissionSet(authenticatedUser, ModeledPermissions.this, effectiveGroups);
              }
  
              @Override
              public ObjectPermissionSet getConnectionPermissions()
                      throws GuacamoleException {
                  return connectionPermissionService.getPermissionSet(authenticatedUser, ModeledPermissions.this, effectiveGroups);
              }
  
              @Override
              public ObjectPermissionSet getSharingProfilePermissions()
                      throws GuacamoleException {
                  return sharingProfilePermissionService.getPermissionSet(authenticatedUser, ModeledPermissions.this, effectiveGroups);
              }
  
              @Override
              public SystemPermissionSet getSystemPermissions()
                      throws GuacamoleException {
                  return systemPermissionService.getPermissionSet(authenticatedUser, ModeledPermissions.this, effectiveGroups);
              }
  
              @Override
              public ObjectPermissionSet getUserPermissions()
                      throws GuacamoleException {
                  return userPermissionService.getPermissionSet(authenticatedUser, ModeledPermissions.this, effectiveGroups);
              }
  
              @Override
              public ObjectPermissionSet getUserGroupPermissions()
                      throws GuacamoleException {
                  return userGroupPermissionService.getPermissionSet(getCurrentUser(), ModeledPermissions.this, effectiveGroups);
              }
  
          };
      }
docs: Returns a Permissions object which represents all permissions granted to
  this entity, including any permissions inherited through group
  membership.
  
  @return
  A Permissions object which represents all permissions granted to
  this entity.