public class PermissionTemplate extends CommonItem<PermissionTemplateData>
Project.setPermissionTemplate(PermissionTemplate)
) to make new
items be shared with the permissions from the template when the
project is the active project.Modifier and Type | Field and Description |
---|---|
static Item |
TYPE
The type of item represented by this class.
|
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
Constructor and Description |
---|
PermissionTemplate(PermissionTemplateData data) |
Modifier and Type | Method and Description |
---|---|
static PermissionTemplate |
getById(DbControl dc,
int id)
Get a permission template item when you know the id.
|
static PermissionTemplate |
getNew(DbControl dc)
Create a new permission template item.
|
ItemQuery<Project> |
getProjects()
Get a query that returns all projects that use this permission template.
|
static ItemQuery<PermissionTemplate> |
getQuery()
Get a query that returns permission templates.
|
Item |
getType()
Get the type of item represented by the object.
|
Set<ItemProxy> |
getUsingItems()
Get all:
Project :s using this permission template
|
boolean |
isUsed()
Check if:
A
Project uses this template
|
getDescription, getName, isRemoved, setDescription, setName, setRemoved
getItemKey, getProjectKey, initPermissions, isShared, onBeforeCommit, setItemKey, setProjectKey
getOwner, isOwner, setOwner, takeOwnership
addUsingItems, addUsingItems, checkPermission, equals, getData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, onAfterCommit, onAfterInsert, onRollback, setDbControl, setProjectDefaults, toString, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getId, getVersion
checkPermission, getPermissions, hasPermission
getOwner, isOwner, setOwner, takeOwnership
public static final Item TYPE
Item.PERMISSIONTEMPLATE
,
getType()
PermissionTemplate(PermissionTemplateData data)
public static PermissionTemplate getNew(DbControl dc) throws BaseException
dc
- The DbControl
which will be used for
permission checking and database accessPermissionTemplate
itemBaseException
- If there is an errorpublic static PermissionTemplate getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
dc
- The DbControl
which will be used for
permission checking and database access.id
- The id of the item to loadPermissionTemplate
itemItemNotFoundException
- If an item with the specified
id is not foundPermissionDeniedException
- If the logged in user doesn't
have Permission.READ
permission to the itemBaseException
- If there is another errorpublic static ItemQuery<PermissionTemplate> getQuery()
ItemQuery
objectpublic Item getType()
Identifiable
Item
enumeration.public boolean isUsed() throws BaseException
Project
uses this template
isUsed
in class BasicItem<PermissionTemplateData>
BaseException
- If not able to tell if item is used or not.BasicItem.getUsingItems()
public Set<ItemProxy> getUsingItems()
Project
:s using this permission template
getUsingItems
in class BasicItem<PermissionTemplateData>
BasicItem.addUsingItems(Set, Item, org.hibernate.Query)