Liferay 6.2-ce-ga5

com.liferay.portal.model.impl
Class ResourceBlockImpl

java.lang.Object
  extended by com.liferay.portal.model.impl.BaseModelImpl<ResourceBlock>
      extended by com.liferay.portal.model.impl.ResourceBlockModelImpl
          extended by com.liferay.portal.model.impl.ResourceBlockBaseImpl
              extended by com.liferay.portal.model.impl.ResourceBlockImpl
All Implemented Interfaces:
BaseModel<ResourceBlock>, ClassedModel, PermissionedModel, PersistedModel, ResourceBlock, ResourceBlockModel, Serializable, Cloneable, Comparable<ResourceBlock>

public class ResourceBlockImpl
extends ResourceBlockBaseImpl

Represents a set of resources of one type that all share the same permissions. This means that if a user can access one resource in a resource block, they can access all of them.

Resource blocks can only contain sets of resources that are all the same type and in the same group. The first constraint is necessary because bitwise action IDs do not always represent the same action between resource types. For instance, the EDIT action could have the bitwise value 2 for bookmark entries, and the value 16 for blog entries. Consequently, even if two resources of different types share the same permissions on the bitwise level, a user does not necessarily have permission to perform the same actions on both.

The second constraint is required because users can have different roles in different groups. If resources from different groups were contained in the same resource block, it would be impossible to check permissions properly when loading resources from multiple groups simultaneously. A user could have access to a certain resource block in one group, but not in another.

The type of resource a resource block contains is specified by the name attribute, which must be the fully qualified class name of a model (such as a blog entry).

The permissionsHash attribute holds a hashed representation of the permissions shared by all the resources contained in the block. When the permissions on an individual resource are changed, a new permissions hash is calculated for it, and the database is checked to determine if a resource block already exists with that hash. If one exists, the resource is moved into that block; otherwise a new block is created.

The referenceCount attribute stores the number of resources in the resource block, meaning those resources whose resourceBlockId is set to the primary key of this resource block. If referenceCount reaches zero, the resource block is no longer needed and may be safely deleted. To ensure that this reference count remains accurate, resources must always call ResourceLocalServiceImpl.deleteResource(com.liferay.portal.model.AuditedModel, int) when a resource is deleted.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.liferay.portal.model.impl.ResourceBlockModelImpl
COLUMN_BITMASK_ENABLED, COMPANYID_COLUMN_BITMASK, DATA_SOURCE, ENTITY_CACHE_ENABLED, FINDER_CACHE_ENABLED, GROUPID_COLUMN_BITMASK, LOCK_EXPIRATION_TIME, NAME_COLUMN_BITMASK, ORDER_BY_JPQL, ORDER_BY_SQL, PERMISSIONSHASH_COLUMN_BITMASK, RESOURCEBLOCKID_COLUMN_BITMASK, SESSION_FACTORY, TABLE_COLUMNS, TABLE_NAME, TABLE_SQL_CREATE, TABLE_SQL_DROP, TX_MANAGER
 
Constructor Summary
ResourceBlockImpl()
           
 
Method Summary
 
Methods inherited from class com.liferay.portal.model.impl.ResourceBlockBaseImpl
persist
 
Methods inherited from class com.liferay.portal.model.impl.ResourceBlockModelImpl
clone, compareTo, equals, getColumnBitmask, getCompanyId, getExpandoBridge, getGroupId, getModelAttributes, getModelClass, getModelClassName, getName, getOriginalCompanyId, getOriginalGroupId, getOriginalName, getOriginalPermissionsHash, getPermissionsHash, getPrimaryKey, getPrimaryKeyObj, getReferenceCount, getResourceBlockId, hashCode, resetOriginalValues, setCompanyId, setExpandoBridgeAttributes, setGroupId, setModelAttributes, setName, setPermissionsHash, setPrimaryKey, setPrimaryKeyObj, setReferenceCount, setResourceBlockId, toCacheModel, toEscapedModel, toModel, toModels, toString, toXmlString
 
Methods inherited from class com.liferay.portal.model.impl.BaseModelImpl
getLocale, isCachedModel, isEscapedModel, isNew, setCachedModel, setExpandoBridgeAttributes, setExpandoBridgeAttributes, setNew, toUnescapedModel
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.liferay.portal.model.ResourceBlockModel
clone, compareTo, getCompanyId, getExpandoBridge, getGroupId, getName, getPermissionsHash, getPrimaryKey, getPrimaryKeyObj, getReferenceCount, getResourceBlockId, hashCode, isCachedModel, isEscapedModel, isNew, setCachedModel, setCompanyId, setExpandoBridgeAttributes, setExpandoBridgeAttributes, setExpandoBridgeAttributes, setGroupId, setName, setNew, setPermissionsHash, setPrimaryKey, setPrimaryKeyObj, setReferenceCount, setResourceBlockId, toCacheModel, toEscapedModel, toString, toUnescapedModel, toXmlString
 
Methods inherited from interface com.liferay.portal.model.BaseModel
getModelAttributes, resetOriginalValues, setModelAttributes
 
Methods inherited from interface com.liferay.portal.model.ClassedModel
getModelClass, getModelClassName
 
Methods inherited from interface com.liferay.portal.model.PermissionedModel
getResourceBlockId, setResourceBlockId
 

Constructor Detail

ResourceBlockImpl

public ResourceBlockImpl()

Liferay 6.2-ce-ga5