-
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Role manager abstract class(interface) added.
Role manager abstract class(interface) added. Changes in include directives. Made necessary changes Removed .github folder.
- Loading branch information
Showing
14 changed files
with
86 additions
and
81 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#include <string> | ||
|
||
// Exception class for unsupported operations. | ||
class IllegalArgumentException{ | ||
std::string error_message; | ||
public: | ||
IllegalArgumentException(std::string error_message){ | ||
this->error_message = error_message; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#include <string> | ||
|
||
// Exception class for unsupported operations. | ||
class UnsupportedOperationException{ | ||
std::string error_message; | ||
public: | ||
UnsupportedOperationException(std::string error_message){ | ||
this->error_message = error_message; | ||
} | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#include <string> | ||
#include <vector> | ||
|
||
using namespace std; | ||
|
||
class RoleManager { | ||
public: | ||
/** | ||
* Clear clears all stored data and resets the role manager to the initial state. | ||
*/ | ||
virtual void clear() = 0; | ||
|
||
/** | ||
* addLink adds the inheritance link between two roles. role: name1 and role: name2. | ||
* domain is a prefix to the roles. | ||
* | ||
* @param name1 the first role (or user). | ||
* @param name2 the second role. | ||
* @param domain the domain the roles belong to. | ||
*/ | ||
virtual void addLink(string name1, string name2, string domain[]) = 0; | ||
|
||
/** | ||
* deleteLink deletes the inheritance link between two roles. role: name1 and role: name2. | ||
* domain is a prefix to the roles. | ||
* | ||
* @param name1 the first role (or user). | ||
* @param name2 the second role. | ||
* @param domain the domain the roles belong to. | ||
*/ | ||
virtual void deleteLink(string name1, string name2, string domain[]) = 0; | ||
|
||
/** | ||
* hasLink determines whether a link exists between two roles. role: name1 inherits role: name2. | ||
* domain is a prefix to the roles. | ||
* | ||
* @param name1 the first role (or a user). | ||
* @param name2 the second role. | ||
* @param domain the domain the roles belong to. | ||
* @return whether name1 inherits name2 (name1 has role name2). | ||
*/ | ||
virtual bool hasLink(string name1, string name2, string domain[]) = 0; | ||
|
||
/** | ||
* getRoles gets the roles that a user inherits. | ||
* domain is a prefix to the roles. | ||
* | ||
* @param name the user (or a role). | ||
* @param domain the domain the roles belong to. | ||
* @return the roles. | ||
*/ | ||
virtual vector<string> getRoles(string name, string domain[]) = 0; | ||
|
||
/** | ||
* getUsers gets the users that inherits a role. | ||
* @param name the role. | ||
* @return the users. | ||
*/ | ||
virtual vector<string> getUsers(string name) = 0; | ||
|
||
/** | ||
* printRoles prints all the roles to log. | ||
*/ | ||
virtual void printRoles() = 0; | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.