Last active
December 12, 2018 10:06
-
-
Save sunloverz/17ad1b3666c93baca535d39c5f5ab4c0 to your computer and use it in GitHub Desktop.
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
Database tables: | |
Users { | |
id | |
name | |
} | |
Roles { | |
id | |
name | |
description | |
} | |
UserRoles { | |
id | |
user_id | |
role_id | |
} | |
Permissions { | |
id | |
name | |
type | |
} | |
RolePermission { | |
id | |
role_id | |
permission_id | |
} | |
UserPermission { | |
id | |
user_id | |
permission_id | |
} | |
A list of functions: | |
## Grant permissions to user via role | |
function RegisterRole(name, description) | |
function GrantPermission(role, name, type) | |
function AssignRoleToUser(user, role) | |
## Grant permissions to a user | |
function GrantPermission(user, name, type) | |
## Check permission | |
function CheckPermission(User, permission_type) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment