code: public CmsPermissionSetCustom getPermissions(CmsRequestContext context, CmsResource resource, CmsUser user)
      throws CmsException {
  
          CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
          CmsPermissionSetCustom result = null;
          try {
              result = m_driverManager.getPermissions(dbc, resource, user);
          } catch (Exception e) {
              dbc.report(
                  null,
                  Messages.get().container(Messages.ERR_GET_PERMISSIONS_2, user.getName(), context.getSitePath(resource)),
                  e);
          } finally {
              dbc.clear();
          }
          return result;
      }
docs: Returns the set of permissions of the current user for a given resource.<p>
  
  @param context the current request context
  @param resource the resource
  @param user the user
  
  @return bit set with allowed permissions
  
  @throws CmsException if something goes wrong