Search in sources :

Example 6 with Permission

use of org.jbei.ice.storage.model.Permission in project ice by JBEI.

the class EntryPermissions method removePermission.

public void removePermission(long permissionId) {
    Permission permission = permissionDAO.get(permissionId);
    if (permission == null)
        return;
    // expect user to be able to modify entry
    authorization.expectWrite(userId, entry);
    // permission must be for entry and specified entry
    if (permission.getEntry() == null || permission.getEntry().getId() != entry.getId())
        return;
    permissionDAO.delete(permission);
}
Also used : AccessPermission(org.jbei.ice.lib.dto.access.AccessPermission) Permission(org.jbei.ice.storage.model.Permission)

Aggregations

Permission (org.jbei.ice.storage.model.Permission)6 AccessPermission (org.jbei.ice.lib.dto.access.AccessPermission)4 Group (org.jbei.ice.storage.model.Group)2 ArrayList (java.util.ArrayList)1 HibernateException (org.hibernate.HibernateException)1 GroupController (org.jbei.ice.lib.group.GroupController)1 DAOException (org.jbei.ice.storage.DAOException)1 Account (org.jbei.ice.storage.model.Account)1 RemoteAccessModel (org.jbei.ice.storage.model.RemoteAccessModel)1