code: public boolean isEditable(CmsObject cms, CmsResource resource) {
  
          if (!cms.getRequestContext().getCurrentProject().isOnlineProject()
              && OpenCms.getRoleManager().hasRole(cms, CmsRole.ROOT_ADMIN)) {
              return true;
          }
          // determine if this resource type is editable for the current user
          CmsPermissionSet permissions = getAccess().getPermissions(cms, resource);
          return permissions.requiresWritePermission();
      }
docs: Checks if the current user has write permissions on the given resource.<p>
  
  @param cms the current cms context
  @param resource the resource to check
  
  @return <code>true</code> if the current user has write permissions on the given resource