code: public void checkPermissions(
          CmsRequestContext context,
          CmsResource resource,
          CmsPermissionSet requiredPermissions,
          boolean checkLock,
          CmsResourceFilter filter)
      throws CmsException, CmsSecurityException {
  
          CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
          try {
              // check the access permissions
              checkPermissions(dbc, resource, requiredPermissions, checkLock, filter);
          } finally {
              dbc.clear();
          }
      }
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 context the current request 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 #checkPermissions(CmsRequestContext, CmsResource, CmsPermissionSet, I_CmsPermissionHandler.CmsPermissionCheckResult)