|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The DynamicRightsManager is used by many other components to check if an user action is allowed.
An implementation can be written to carry out the incentives for the IncentiveManager (that are basically
a question of the user's score and his rights). To compute the users rights efficiently, an implementation can register itself
as a ScoringListener and compute the rights in the scored()
method.
Use the mayXXX()
methods for efficiency. The checkXXX()
methods exist for convenience.
An implementation should realize the logic within the former methods, the latter methods should use the former ones.
The DynamicRightsManager implementation can be configured with the key cf.dynamicrightsmanager
in the ConsensusFoundation.properties
configuration file. It's an optional component.
The implementation is loaded by the ConsensusFoundation
constructor. For successful instantiation,
the DynamicRightsManager implementation must provide a default constructor without arguments.
ConsensusFoundation
Method Summary | |
void |
checkAddAttribute(User user,
Attribute attr,
Attributeable attributeable)
Checks if the user is allowed to add the attribute to the given attributeable element (a topic). |
void |
checkAddClass(User user,
Topic base)
Checks if the user is allowed to add a superclass to a class topic. |
void |
checkAddRating(Rating rating,
Rateable rateable)
Checks if a user is allowed to assign a rating to a certain rateable element. |
void |
checkAddSynonym(User user,
Topic base)
Checks if the user is allowed to add a synonymous topic to a given topic. |
void |
checkAddType(User user,
Topic base)
Checks if the user is allowed to add a type topic to a given topic. |
void |
checkChangeAssociation(User user,
Association assoc)
Checks if the user is allowed to change an association (add/remove roles/topics). |
void |
checkChangeAttributeValue(User user,
Attribute attr)
Checks if the user is allowed to change the attribute's value. |
void |
checkChangeConceptComment(User user,
Concept concept)
Checks if the user is allowed to change the comment of a certain concept. |
void |
checkChangeOccurrence(User user)
Checks if the user is allowed to change (create/delete) occurrences. |
void |
checkChangeUserComment(User user,
User commentated)
Checks if the user is allowed to change the comment of a certain user (including himself). |
void |
checkCreateAssociation(User user,
Topic type)
Checks if the user is allowed to create associations of the given type. |
void |
checkCreateAttribute(User user,
Topic type)
Checks if the user is allowed to create attributes of the given type. |
void |
checkCreateClassTopic(User user,
Topic cls)
Checks if the user is allowed to create topics of the given superclass. |
void |
checkCreateRating(User user)
Checks if the user is allowed to create ratings. |
void |
checkCreateTopic(User user,
Topic type)
Checks if the user is allowed to create topics of the given type. |
void |
checkDeleteAssociation(User user,
Association assoc)
Checks if a user is allowed to remove an association permanently from the ontology. |
void |
checkDeleteTopic(User user,
Topic topic)
Checks if a user is allowed to remove a topic permanently from the ontology. |
void |
checkMergeTopics(User user,
Topic topic1,
Topic topic2)
Checks if a user is allowed to merge to topics. |
void |
checkQuery(User user,
String query)
Checks if the user is allowed to do queries using the provided query language(s). |
void |
checkRemoveAttribute(User user,
Attribute attr)
Checks if the user is allowed to remove the attribute from its topic. |
void |
checkRemoveClass(User user,
SuperSubclass cls)
Checks if the user is allowed to remove a superclass from a class topic. |
void |
checkRemoveRating(User remover,
Rating rating)
Checks if a user is allowed to remove a rating permanently from an element. |
void |
checkRemoveSynonym(User user,
Synonym synonym)
Checks if the user is allowed to remove a synonym relationship between two topics. |
void |
checkRemoveType(User user,
TypeInstance type)
Checks if the user is allowed to remove a type from a topic. |
void |
checkViewAssociation(User user,
Association assoc)
Checks if the user is allowed to view a certain association. |
void |
checkViewAttribute(User user,
Attribute attr)
Checks if the user is allowed to see a certain attribute. |
void |
checkViewTopic(User user,
Topic topic)
Checks if the user is allowed to view a certain topic. |
void |
init(Properties config,
LoggingManager logging,
UserManager users,
OntologyManager ontology,
IncentiveManager incentive)
This method is called by the ConsensusFoundation constructor to initialize the DynamicRightsManager. |
boolean |
mayAddAttribute(User user,
Attribute attr,
Attributeable attributeable)
Checks if the user is allowed to add the attribute to the given attributeable element (a topic). |
boolean |
mayAddClass(User user,
Topic base)
Checks if the user is allowed to add a superclass to a class topic. |
boolean |
mayAddRating(Rating rating,
Rateable rateable)
Checks if a user is allowed to assign a rating to a certain rateable element. |
boolean |
mayAddSynonym(User user,
Topic base)
Checks if the user is allowed to add a synonymous topic to a given topic. |
boolean |
mayAddType(User user,
Topic base)
Checks if the user is allowed to add a type topic to a given topic. |
boolean |
mayChangeAssociation(User user,
Association assoc)
Checks if the user is allowed to change an association (add/remove roles/topics). |
boolean |
mayChangeAttributeValue(User user,
Attribute attr)
Checks if the user is allowed to change the attribute's value. |
boolean |
mayChangeConceptComment(User user,
Concept concept)
Checks if the user is allowed to change the comment of a certain concept. |
boolean |
mayChangeOccurrence(User user)
Checks if the user is allowed to change (create/delete) occurrences. |
boolean |
mayChangeUserComment(User user,
User commentated)
Checks if the user is allowed to change the comment of a certain user (including himself). |
boolean |
mayCreateAssociation(User user,
Topic type)
Checks if the user is allowed to create associations of the given type. |
boolean |
mayCreateAttribute(User user,
Topic type)
Checks if the user is allowed to create attributes of the given type. |
boolean |
mayCreateClassTopic(User user,
Topic cls)
Checks if the user is allowed to create topics of the given superclass. |
boolean |
mayCreateRating(User user)
Checks if the user is allowed to create ratings. |
boolean |
mayCreateTopic(User user,
Topic type)
Checks if the user is allowed to create topics of the given type. |
boolean |
mayDeleteAssociation(User user,
Association assoc)
Checks if a user is allowed to remove an association permanently from the ontology. |
boolean |
mayDeleteTopic(User user,
Topic topic)
Checks if a user is allowed to remove a topic permanently from the ontology. |
boolean |
mayMergeTopics(User user,
Topic topic1,
Topic topic2)
Checks if a user is allowed to merge to topics. |
boolean |
mayQuery(User user,
String query)
Checks if the user is allowed to do queries using the provided query language(s). |
boolean |
mayRemoveAttribute(User user,
Attribute attr)
Checks if the user is allowed to remove the attribute from its topic. |
boolean |
mayRemoveClass(User user,
SuperSubclass cls)
Checks if the user is allowed to remove a superclass from a class topic. |
boolean |
mayRemoveRating(User remover,
Rating rating)
Checks if a user is allowed to remove a rating permanently from an element. |
boolean |
mayRemoveSynonym(User user,
Synonym synonym)
Checks if the user is allowed to remove a synonym relationship between two topics. |
boolean |
mayRemoveType(User user,
TypeInstance type)
Checks if the user is allowed to remove a type from a topic. |
boolean |
mayViewAssociation(User user,
Association assoc)
Checks if the user is allowed to view a certain association. |
boolean |
mayViewAttribute(User user,
Attribute attr)
Checks if the user is allowed to see a certain attribute. |
boolean |
mayViewTopic(User user,
Topic topic)
Checks if the user is allowed to view a certain topic. |
Methods inherited from interface de.uka.ipd.consensus.foundation.ConsensusFoundationModule |
getConsensusFoundationManager, getVersion, initCompleted, shutdown |
Method Detail |
public void init(Properties config, LoggingManager logging, UserManager users, OntologyManager ontology, IncentiveManager incentive) throws Exception
ConsensusFoundation
constructor to initialize the DynamicRightsManager.
config
- all entries from ConsensusFoundation.properties
logging
- the successfully initialized LoggingManager instanceusers
- the the successfully initialized UserManager instanceontology
- the the successfully initialized OntologyManager instanceincentive
- the the successfully initialized IncentiveManager instance or null
, if no IncentiveManager is available
Exception
- if any error occurs (startup of the application is aborted in this case)ConsensusFoundation.ConsensusFoundation()
public boolean mayCreateTopic(User user, Topic type)
user
- the user who wants to create a topictype
- the type of the topic to be created, including null
for a typeless topic
true
if the user is allowed to create the topic, false
otherwisecheckCreateTopic(User, Topic)
public boolean mayCreateClassTopic(User user, Topic cls)
user
- user the user who wants to create a class topiccls
- the superclass of the class topic to be created, including null
for a root class topic
true
if the user is allowed to create the class topic, false
otherwisecheckCreateClassTopic(User, Topic)
,
Topic.isClassTopic()
public boolean mayViewTopic(User user, Topic topic)
user
- the user who wants to see the topictopic
- the topic in question
true
if the user is allowed to view the topic, false
otherwisecheckViewTopic(User, Topic)
public boolean mayDeleteTopic(User user, Topic topic)
user
- the user who wants to delete the topictopic
- the topic to be deleted
true
if the user is allowed to delete the topic, false
otherwisecheckDeleteTopic(User, Topic)
public boolean mayMergeTopics(User user, Topic topic1, Topic topic2)
user
- the user who wants to merge the topicstopic1
- the first topic to be mergedtopic2
- the second topic to be merged
true
if the user is allowed to merge the topics, false
otherwisecheckMergeTopics(User, Topic, Topic)
public boolean mayCreateAssociation(User user, Topic type)
user
- the user who wants to create an associationtype
- the type of the association to be created, including null
for a typeless association
true
if the user is allowed to create the association, false
otherwisecheckCreateAssociation(User, Topic)
public boolean mayViewAssociation(User user, Association assoc)
user
- the user who wants to see the associationassoc
- the association in question
true
if the user is allowed to see the association, false
otherwisecheckViewAssociation(User, Association)
public boolean mayChangeAssociation(User user, Association assoc)
user
- the user who wants to change the associationassoc
- the association to be changed
true
if the user is allowed to change the association, false
otherwisecheckChangeAssociation(User, Association)
public boolean mayDeleteAssociation(User user, Association assoc)
user
- the user who wants to delete the associationassoc
- the association to be deleted
true
if the user is allowed to delete the association, false
otherwisecheckDeleteAssociation(User, Association)
public boolean mayCreateAttribute(User user, Topic type)
user
- the user who wants to create an attributetype
- the type of the attribute to be created, including null
for a typeless attribute
true
if the user is allowed to create the attribute, false
otherwisecheckCreateAttribute(User, Topic)
,
mayAddAttribute(User, Attribute, Attributeable)
public boolean mayAddAttribute(User user, Attribute attr, Attributeable attributeable)
user
- the user who wants to add the attributeattr
- the attribute to be addedattributeable
- the topic that will be container of the attribute
true
if the user is allowed to add the attribute, false
otherwisecheckAddAttribute(User, Attribute, Attributeable)
,
mayCreateAttribute(User, Topic)
public boolean mayRemoveAttribute(User user, Attribute attr)
user
- the user who wants to remove the attributeattr
- the attribute to be removed
true
if the user is allowed to remove the attribute, false
otherwisecheckRemoveAttribute(User, Attribute)
public boolean mayViewAttribute(User user, Attribute attr)
user
- the user who wants to see the attributeattr
- the attribute in question
true
if the user is allowed to see the attribute, false
otherwisecheckViewAttribute(User, Attribute)
public boolean mayChangeAttributeValue(User user, Attribute attr)
user
- the user who wants to change the valueattr
- the attribute in question
true
if the user is allowed to change the attribute's value, false
otherwisecheckChangeAttributeValue(User, Attribute)
public boolean mayCreateRating(User user)
user
- the user who wants to create a rating
true
if the user is allowed to create ratings, false
otherwisecheckCreateRating(User)
,
mayAddRating(Rating, Rateable)
public boolean mayAddRating(Rating rating, Rateable rateable)
rating
- the rating to be assignedrateable
- the rateable element that will receive the rating
true
if the user is allowed to add the rating, false
otherwisecheckAddRating(Rating, Rateable)
,
mayCreateRating(User)
public boolean mayRemoveRating(User remover, Rating rating)
remover
- the user who wants to remove the ratingrating
- the rating to be removed
true
if the user is allowed to remove the rating, false
otherwisecheckRemoveRating(User, Rating)
public boolean mayChangeConceptComment(User user, Concept concept)
user
- the user who wants to change the commentconcept
- the concept in question
true
if the user is allowed to change the comment, false
otherwisecheckChangeConceptComment(User, Concept)
public boolean mayChangeUserComment(User user, User commentated)
user
- the user who wants to change the commentcommentated
- the user who's comment string will be changed
true
if the user is allowed to change the comment, false
otherwisecheckChangeUserComment(User, User)
public boolean mayChangeOccurrence(User user)
user
- the user who wants to change an occurrence
true
if the user is allowed to change occurrences, false
otherwisecheckChangeOccurrence(User)
public boolean mayAddSynonym(User user, Topic base)
user
- the user who wants to add the synonymbase
- the topic that is assigned the synonymous topic
true
if the user is allowed to add the synonym, false
otherwisecheckAddSynonym(User, Topic)
public boolean mayRemoveSynonym(User user, Synonym synonym)
user
- the user who wants to remove the synonym relationshipsynonym
- the Synonym object containing the two synonymous topics
true
if the user is allowed to remove the synonym, false
otherwisecheckRemoveSynonym(User, Synonym)
public boolean mayAddType(User user, Topic base)
user
- the user who wants to add a typebase
- the topic which is assigned the new type
true
if the user is allowed to add a type, false
otherwisecheckAddType(User, Topic)
public boolean mayRemoveType(User user, TypeInstance type)
user
- the user who wants to remove a typetype
- the TypeInstance object which contains both the type topic and the base topic
true
if the user is allowed to remove the type, false
otherwisecheckRemoveType(User, TypeInstance)
public boolean mayAddClass(User user, Topic base)
user
- the user who wants to add the superclassbase
- the topic that will be assigned a new superclass
true
if the user is allowed to add a superclass, false
otherwisecheckAddClass(User, Topic)
,
Topic.isClassTopic()
public boolean mayRemoveClass(User user, SuperSubclass cls)
user
- the user who wants to remove the superclasscls
- the SuperSubclass object containing both the superclass and the subclass topic
true
if the user is allowed to remove the superclass, false
otherwisecheckRemoveClass(User, SuperSubclass)
public boolean mayQuery(User user, String query)
user
- the user who wants to do the queryquery
- the query string
true
if the user is allowed to do the query, false
otherwisecheckQuery(User, String)
public void checkCreateTopic(User user, Topic type) throws DynamicRightsManagerException
This method returns silently if the user is granted the right.
user
- the user who wants to create a topictype
- the type of the topic to be created, including null
for a typeless topic
DynamicRightsManagerException
- if the user is not allowed to create the topicmayCreateTopic(User, Topic)
public void checkCreateClassTopic(User user, Topic cls) throws DynamicRightsManagerException
This method returns silently if the user is granted the right.
user
- user the user who wants to create a class topiccls
- the superclass of the class topic to be created, including null
for a root class topic
DynamicRightsManagerException
- if the user is not allowed to create the class topicmayCreateClassTopic(User, Topic)
,
Topic.isClassTopic()
public void checkViewTopic(User user, Topic topic) throws DynamicRightsManagerException
This method returns silently if the user is granted the right.
user
- the user who wants to see the topictopic
- the topic in question
DynamicRightsManagerException
- if the user is not allowed to view the topicmayViewTopic(User, Topic)
public void checkDeleteTopic(User user, Topic topic) throws DynamicRightsManagerException
This method returns silently if the user is granted the right.
user
- the user who wants to delete the topictopic
- the topic to be deleted
DynamicRightsManagerException
- if the user is not allowed to delete the topicmayDeleteTopic(User, Topic)
public void checkMergeTopics(User user, Topic topic1, Topic topic2) throws DynamicRightsManagerException
This method returns silently if the user is granted the right.
user
- the user who wants to merge the topicstopic1
- the first topic to be mergedtopic2
- the second topic to be merged
DynamicRightsManagerException
- if the user is not allowed to merge the topicsmayMergeTopics(User, Topic, Topic)
public void checkCreateAssociation(User user, Topic type) throws DynamicRightsManagerException
This method returns silently if the user is granted the right.
user
- the user who wants to create an associationtype
- the type of the association to be created, including null
for a typeless association
DynamicRightsManagerException
- if the user is not allowed to create the associationmayCreateAssociation(User, Topic)
public void checkViewAssociation(User user, Association assoc) throws DynamicRightsManagerException
This method returns silently if the user is granted the right.
user
- the user who wants to see the associationassoc
- the association in question
DynamicRightsManagerException
- if the user is not allowed to see the associationmayViewAssociation(User, Association)
public void checkChangeAssociation(User user, Association assoc) throws DynamicRightsManagerException
This method returns silently if the user is granted the right.
user
- the user who wants to change the associationassoc
- the association to be changed
DynamicRightsManagerException
- if the user is not allowed to change the associationmayChangeAssociation(User, Association)
public void checkDeleteAssociation(User user, Association assoc) throws DynamicRightsManagerException
This method returns silently if the user is granted the right.
user
- the user who wants to delete the associationassoc
- the association to be deleted
DynamicRightsManagerException
- if the user is not allowed to delete the associationmayDeleteAssociation(User, Association)
public void checkCreateAttribute(User user, Topic type) throws DynamicRightsManagerException
This method returns silently if the user is granted the right.
user
- the user who wants to create an attributetype
- the type of the attribute to be created, including null
for a typeless attribute
DynamicRightsManagerException
- if the user is not allowed to create the attributemayCreateAttribute(User, Topic)
,
checkAddAttribute(User, Attribute, Attributeable)
public void checkAddAttribute(User user, Attribute attr, Attributeable attributeable) throws DynamicRightsManagerException
This method returns silently if the user is granted the right.
user
- the user who wants to add the attributeattr
- the attribute to be addedattributeable
- the topic that will be container of the attribute
DynamicRightsManagerException
- if the user is not allowed to add the attributemayAddAttribute(User, Attribute, Attributeable)
,
checkCreateAttribute(User, Topic)
public void checkRemoveAttribute(User user, Attribute attr) throws DynamicRightsManagerException
This method returns silently if the user is granted the right.
user
- the user who wants to remove the attributeattr
- the attribute to be removed
DynamicRightsManagerException
- if the user is not allowed to remove the attributemayRemoveAttribute(User, Attribute)
public void checkViewAttribute(User user, Attribute attr) throws DynamicRightsManagerException
This method returns silently if the user is granted the right.
user
- the user who wants to see the attributeattr
- the attribute in question
DynamicRightsManagerException
- if the user is not allowed to see the attributemayViewAttribute(User, Attribute)
public void checkChangeAttributeValue(User user, Attribute attr) throws DynamicRightsManagerException
This method returns silently if the user is granted the right.
user
- the user who wants to change the valueattr
- the attribute in question
DynamicRightsManagerException
- if the user is not allowed to change the attribute's valuemayChangeAttributeValue(User, Attribute)
public void checkCreateRating(User user) throws DynamicRightsManagerException
This method returns silently if the user is granted the right.
user
- the user who wants to create a rating
DynamicRightsManagerException
- if the user is not allowed to create ratingsmayCreateRating(User)
,
checkAddRating(Rating, Rateable)
public void checkAddRating(Rating rating, Rateable rateable) throws DynamicRightsManagerException
This method returns silently if the user is granted the right.
rating
- the rating to be assignedrateable
- the rateable element that will receive the rating
DynamicRightsManagerException
- if the user is not allowed to add the ratingmayAddRating(Rating, Rateable)
,
checkCreateRating(User)
public void checkRemoveRating(User remover, Rating rating) throws DynamicRightsManagerException
This method returns silently if the user is granted the right.
remover
- the user who wants to remove the ratingrating
- the rating to be removed
DynamicRightsManagerException
- if the user is not allowed to remove the ratingmayRemoveRating(User, Rating)
public void checkChangeConceptComment(User user, Concept concept) throws DynamicRightsManagerException
This method returns silently if the user is granted the right.
user
- the user who wants to change the commentconcept
- the concept in question
DynamicRightsManagerException
- if the user is not allowed to change the commentmayChangeConceptComment(User, Concept)
public void checkChangeUserComment(User user, User commentated) throws DynamicRightsManagerException
This method returns silently if the user is granted the right.
user
- the user who wants to change the commentcommentated
- the user who's comment string will be changed
DynamicRightsManagerException
- if the user is not allowed to change the commentmayChangeUserComment(User, User)
public void checkChangeOccurrence(User user) throws DynamicRightsManagerException
This method returns silently if the user is granted the right.
user
- the user who wants to change an occurrence
DynamicRightsManagerException
- if the user is not allowed to change occurrencesmayChangeOccurrence(User)
public void checkAddSynonym(User user, Topic base) throws DynamicRightsManagerException
This method returns silently if the user is granted the right.
user
- the user who wants to add the synonymbase
- the topic that is assigned the synonymous topic
DynamicRightsManagerException
- if the user is not allowed to add a synonymmayAddSynonym(User, Topic)
public void checkRemoveSynonym(User user, Synonym synonym) throws DynamicRightsManagerException
This method returns silently if the user is granted the right.
user
- the user who wants to remove the synonym relationshipsynonym
- the Synonym object containing the two synonymous topics
DynamicRightsManagerException
- if the user is not allowed to remove the synonymmayRemoveSynonym(User, Synonym)
public void checkAddType(User user, Topic base) throws DynamicRightsManagerException
This method returns silently if the user is granted the right.
user
- the user who wants to add a typebase
- the topic which is assigned the new type
DynamicRightsManagerException
- if the user is not allowed to add a typemayAddType(User, Topic)
public void checkRemoveType(User user, TypeInstance type) throws DynamicRightsManagerException
This method returns silently if the user is granted the right.
user
- the user who wants to remove a typetype
- the TypeInstance object which contains both the type topic and the base topic
DynamicRightsManagerException
- if the user is not allowed to remove the typemayRemoveType(User, TypeInstance)
public void checkAddClass(User user, Topic base) throws DynamicRightsManagerException
This method returns silently if the user is granted the right.
user
- the user who wants to add the superclassbase
- the topic that will be assigned a new superclass
DynamicRightsManagerException
- if the user is not allowed to add a superclassmayAddClass(User, Topic)
,
Topic.isClassTopic()
public void checkRemoveClass(User user, SuperSubclass cls) throws DynamicRightsManagerException
This method returns silently if the user is granted the right.
user
- the user who wants to remove the superclasscls
- the SuperSubclass object containing both the superclass and the subclass topic
DynamicRightsManagerException
- if the user is not allowed to remove the superclassmayRemoveClass(User, SuperSubclass)
public void checkQuery(User user, String query) throws DynamicRightsManagerException
This method returns silently if the user is granted the right.
user
- the user who wants to do the queryquery
- the query string
DynamicRightsManagerException
- if the user is not allowed to do the querymayQuery(User, String)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |