code: protected void checkPermissions(
          CmsDbContext dbc,
          CmsResource resource,
          CmsPermissionSet requiredPermissions,
          boolean checkLock,
          CmsResourceFilter filter)
      throws CmsException, CmsSecurityException {
  
          // get the permissions
          I_CmsPermissionHandler.CmsPermissionCheckResult permissions = hasPermissions(
              dbc,
              resource,
              requiredPermissions,
              checkLock,
              filter);
          if (!permissions.isAllowed()) {
              checkPermissions(dbc.getRequestContext(), resource, requiredPermissions, permissions);
          }
      }
docs: Performs a blocking permission check on a resource.<p>
  
  If the required permissions are not satisfied by the permissions the user has on the resource,
  an exception is thrown.<p>
  
  @param dbc the current database context
  @param resource the resource on which permissions are required
  @param requiredPermissions the set of permissions required to access the resource
  @param checkLock if true, the lock status of the resource is also checked
  @param filter the filter for the resource
  
  @throws CmsException in case of any i/o error
  @throws CmsSecurityException if the required permissions are not satisfied
  
  @see #hasPermissions(CmsRequestContext, CmsResource, CmsPermissionSet, boolean, CmsResourceFilter)