public class PermissionDAO extends HibernateRepository<Permission>
Permission
data accessor ObjectConstructor and Description |
---|
PermissionDAO() |
Modifier and Type | Method and Description |
---|---|
int |
clearPermissions(Folder folder) |
int |
clearPermissions(Group group) |
protected org.hibernate.query.Query<Permission> |
createPermissionQuery(Entry entry,
Folder folder,
BulkUpload upload,
Account account,
Group group,
boolean canRead,
boolean canWrite) |
Permission |
get(long id) |
List<Long> |
getCanReadEntries(Account account,
List<Group> groups,
List<Long> entries)
Filters the given list, removing those that the specified account does not have read privileges on
// todo : this doesn't check permissions from folder (get list of all folders entries are in)
|
List<Permission> |
getEntryPermissions(Entry entry) |
List<Permission> |
getFolderPermissions(Folder folder) |
List<Folder> |
getFolders(Group group) |
boolean |
hasPermission(Entry entry,
Folder folder,
BulkUpload upload,
Account account,
Group group,
boolean canRead,
boolean canWrite) |
boolean |
hasPermissionMulti(Entry entry,
Set<Folder> folders,
Account account,
List<Group> groups,
boolean canRead,
boolean canWrite) |
boolean |
hasSetWriteFolderPermission(Folder folder,
Account account) |
int |
removePermission(Entry entry,
Folder folder,
BulkUpload upload,
Account account,
Group group,
boolean canRead,
boolean canWrite) |
List<Account> |
retrieveAccountPermissions(Folder folder,
boolean canWrite,
boolean canRead) |
List<Folder> |
retrieveFolderPermissions(Account account,
Set<Group> accountGroups) |
List<Group> |
retrieveGroupPermissions(Folder folder,
boolean canWrite,
boolean canRead) |
Permission |
retrievePermission(Entry entry,
Folder folder,
BulkUpload upload,
Account account,
Group group,
boolean canRead,
boolean canWrite) |
create, currentSession, delete, get, getBuilder, update
public boolean hasPermission(Entry entry, Folder folder, BulkUpload upload, Account account, Group group, boolean canRead, boolean canWrite)
public boolean hasPermissionMulti(Entry entry, Set<Folder> folders, Account account, List<Group> groups, boolean canRead, boolean canWrite)
public Permission retrievePermission(Entry entry, Folder folder, BulkUpload upload, Account account, Group group, boolean canRead, boolean canWrite)
protected org.hibernate.query.Query<Permission> createPermissionQuery(Entry entry, Folder folder, BulkUpload upload, Account account, Group group, boolean canRead, boolean canWrite)
public int removePermission(Entry entry, Folder folder, BulkUpload upload, Account account, Group group, boolean canRead, boolean canWrite)
public List<Permission> getEntryPermissions(Entry entry)
public List<Permission> getFolderPermissions(Folder folder)
public List<Account> retrieveAccountPermissions(Folder folder, boolean canWrite, boolean canRead)
public boolean hasSetWriteFolderPermission(Folder folder, Account account)
public List<Group> retrieveGroupPermissions(Folder folder, boolean canWrite, boolean canRead)
public int clearPermissions(Folder folder)
public int clearPermissions(Group group)
public List<Folder> retrieveFolderPermissions(Account account, Set<Group> accountGroups)
public List<Long> getCanReadEntries(Account account, List<Group> groups, List<Long> entries)
account
- account to filter entries bygroups
- groups that this account belongs toentries
- list of entry ids to filterpublic Permission get(long id)
Copyright © 2017. All rights reserved.