Package com._1c.g5.v8.dt.bm.index.rights
Class SingleObjectRightsDescription
- java.lang.Object
-
- com._1c.g5.v8.dt.bm.index.rights.SingleObjectRightsDescription
-
- All Implemented Interfaces:
IRightsDescription
public class SingleObjectRightsDescription extends Object implements IRightsDescription
The implementation ofIRightsDescription
for a single object.- See Also:
BaseRightsDescription
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,Boolean>
objectRights
The object rights
-
Constructor Summary
Constructors Constructor Description SingleObjectRightsDescription(Map<String,Boolean> objectRights, boolean isSetForNewObjects, boolean isSetForAttributesByDefault, boolean isIndependentRightsOfChildObjects)
Creates a new instance ofSingleObjectRightsDescription
for a single object.SingleObjectRightsDescription(Map<String,Boolean> objectRights, boolean hasRls, boolean isSetForNewObjects, boolean isSetForAttributesByDefault, boolean isIndependentRightsOfChildObjects)
Creates a new instance ofSingleObjectRightsDescription
for a single top object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getNumberOfCustomRightsSetForAttributesByDefault(long topObjectId)
Returns the number of custom rights among child objects of the specified top object for which the default right value is determined by "Set rights for attributes and tabular sections by default" flag.int
getNumberOfCustomRightsSetForNewObjects(long topObjectId)
Returns the number of custom rights among child objects (include the specified top object) of the specified top object for which the default right value is determined by "Set rights for new objects" flag.int
getNumberOfSetRights(long topObjectId)
Returns the number of set rights among child objects of the specified top object for which the default right value is not determined by "Set rights for new objects" flag or "Set rights for attributes and tabular sections by default" flag.Set<Long>
getObjectIds()
Gets the set of object ids the rights specified for.Map<String,Boolean>
getRights(long bmObjectId)
Gets the rights of the object.Set<Long>
getTopObjectsWithNonDefaultRights()
Gets top objects ids with own non default rights or having descendants with non default rights.boolean
hasTopObjectsRls(long bmObjectId)
Determines whether the object with the given id has at least one Rls.boolean
isIndependentRightsOfChildObjects()
Gets the value of the 'independentRightsOfChildObjects' flag.boolean
isSetForAttributesByDefault()
Gets the value of the 'setForAttributesByDefault' flag.boolean
isSetForNewObjects()
Gets the value of the 'setForNewObjects' flag.
-
-
-
Constructor Detail
-
SingleObjectRightsDescription
public SingleObjectRightsDescription(Map<String,Boolean> objectRights, boolean isSetForNewObjects, boolean isSetForAttributesByDefault, boolean isIndependentRightsOfChildObjects)
Creates a new instance ofSingleObjectRightsDescription
for a single object.- Parameters:
objectRights
- the object rights, can not benull
isSetForNewObjects
- the 'setForNewObjects' flagisSetForAttributesByDefault
- the 'setForAttributesByDefault' flagisIndependentRightsOfChildObjects
- the 'independentRightsOfChildObjects' flag
-
SingleObjectRightsDescription
public SingleObjectRightsDescription(Map<String,Boolean> objectRights, boolean hasRls, boolean isSetForNewObjects, boolean isSetForAttributesByDefault, boolean isIndependentRightsOfChildObjects)
Creates a new instance ofSingleObjectRightsDescription
for a single top object.- Parameters:
objectRights
- the object rights, can not benull
hasRls
- the 'hasRls' flagisSetForNewObjects
- the 'setForNewObjects' flagisSetForAttributesByDefault
- the 'setForAttributesByDefault' flagisIndependentRightsOfChildObjects
- the 'independentRightsOfChildObjects' flag
-
-
Method Detail
-
getRights
public Map<String,Boolean> getRights(long bmObjectId)
Description copied from interface:IRightsDescription
Gets the rights of the object.- Specified by:
getRights
in interfaceIRightsDescription
- Parameters:
bmObjectId
- the unique identifier of the object rights get for- Returns:
- the object rights, may be
null
-
getObjectIds
public Set<Long> getObjectIds()
Description copied from interface:IRightsDescription
Gets the set of object ids the rights specified for.- Specified by:
getObjectIds
in interfaceIRightsDescription
- Returns:
- the set of object ids, can not be
null
-
getTopObjectsWithNonDefaultRights
public Set<Long> getTopObjectsWithNonDefaultRights()
Description copied from interface:IRightsDescription
Gets top objects ids with own non default rights or having descendants with non default rights.- Specified by:
getTopObjectsWithNonDefaultRights
in interfaceIRightsDescription
- Returns:
- the set of top object ids with non default rights, can not be
null
-
getNumberOfCustomRightsSetForNewObjects
public int getNumberOfCustomRightsSetForNewObjects(long topObjectId)
Description copied from interface:IRightsDescription
Returns the number of custom rights among child objects (include the specified top object) of the specified top object for which the default right value is determined by "Set rights for new objects" flag.- Specified by:
getNumberOfCustomRightsSetForNewObjects
in interfaceIRightsDescription
- Parameters:
topObjectId
- the top object id to get the number of custom rights among child objects- Returns:
- the number of custom rights among child objects for which the default right value is determined by "Set rights for new objects" flag
-
getNumberOfCustomRightsSetForAttributesByDefault
public int getNumberOfCustomRightsSetForAttributesByDefault(long topObjectId)
Description copied from interface:IRightsDescription
Returns the number of custom rights among child objects of the specified top object for which the default right value is determined by "Set rights for attributes and tabular sections by default" flag.- Specified by:
getNumberOfCustomRightsSetForAttributesByDefault
in interfaceIRightsDescription
- Parameters:
topObjectId
- the top object id to get the number of custom rights among child objects- Returns:
- the number of custom rights among child objects for which the default right value is determined by "Set rights for attributes and tabular sections by default" flag
-
getNumberOfSetRights
public int getNumberOfSetRights(long topObjectId)
Description copied from interface:IRightsDescription
Returns the number of set rights among child objects of the specified top object for which the default right value is not determined by "Set rights for new objects" flag or "Set rights for attributes and tabular sections by default" flag.- Specified by:
getNumberOfSetRights
in interfaceIRightsDescription
- Parameters:
topObjectId
- the top object id to get the number of set rights among child objects- Returns:
- the number of set rights among child objects of the specified top object for which the default right value is not determined by "Set rights for new objects" flag or "Set rights for attributes and tabular sections by default" flag
-
hasTopObjectsRls
public boolean hasTopObjectsRls(long bmObjectId)
Description copied from interface:IRightsDescription
Determines whether the object with the given id has at least one Rls.- Specified by:
hasTopObjectsRls
in interfaceIRightsDescription
- Parameters:
bmObjectId
- the unique identifier of the object the 'Has Rls' condition is checked for- Returns:
true
if the object has at least one Rls andfalse
otherwise
-
isSetForNewObjects
public boolean isSetForNewObjects()
Description copied from interface:IRightsDescription
Gets the value of the 'setForNewObjects' flag.- Specified by:
isSetForNewObjects
in interfaceIRightsDescription
- Returns:
true
if the 'setForNewObjects' flag is set andfalse
otherwise
-
isSetForAttributesByDefault
public boolean isSetForAttributesByDefault()
Description copied from interface:IRightsDescription
Gets the value of the 'setForAttributesByDefault' flag.- Specified by:
isSetForAttributesByDefault
in interfaceIRightsDescription
- Returns:
true
if the 'setForAttributesByDefault' flag is set andfalse
otherwise
-
isIndependentRightsOfChildObjects
public boolean isIndependentRightsOfChildObjects()
Description copied from interface:IRightsDescription
Gets the value of the 'independentRightsOfChildObjects' flag.- Specified by:
isIndependentRightsOfChildObjects
in interfaceIRightsDescription
- Returns:
true
if the 'independentRightsOfChildObjects' flag is set andfalse
otherwise
-
-