Search in sources :

Example 1 with EntryPermissions

use of org.jbei.ice.lib.entry.EntryPermissions in project ice by JBEI.

the class FolderPermissions method disablePublicReadAccess.

public boolean disablePublicReadAccess() {
    authorization.expectWrite(userId, folder);
    GroupController groupController = new GroupController();
    Group publicGroup = groupController.createOrRetrievePublicGroup();
    permissionDAO.removePermission(null, folder, null, null, publicGroup, true, false);
    if (folder.isPropagatePermissions()) {
        for (Entry folderContent : folder.getContents()) {
            EntryPermissions entryPermissions = new EntryPermissions(Long.toString(folderContent.getId()), userId);
            entryPermissions.disablePublicReadAccess();
        }
    }
    return true;
}
Also used : GroupController(org.jbei.ice.lib.group.GroupController) EntryPermissions(org.jbei.ice.lib.entry.EntryPermissions)

Aggregations

EntryPermissions (org.jbei.ice.lib.entry.EntryPermissions)1 GroupController (org.jbei.ice.lib.group.GroupController)1