code: public CmsPermissionSetCustom getPermissions(CmsDbContext dbc, CmsResource resource, CmsUser user)
      throws CmsException {
  
          CmsAccessControlList acList = getAccessControlList(dbc, resource, false);
          return acList.getPermissions(user, getGroupsOfUser(dbc, user.getName(), false), getRolesForUser(dbc, user));
      }
docs: Returns the set of permissions of the current user for a given resource.<p>
  
  @param dbc the current database context
  @param resource the resource
  @param user the user
  
  @return bit set with allowed permissions
  
  @throws CmsException if something goes wrong