nirix/traq — comment on commit f4837748e2f16127b4e6dce030accb0cc3c2e94c
File:  line 0
By nirix:

I've been thinking about the permissions.

The new permissions system is going to be separate from the user groups.

The permission system will be based off one I created a while ago for another project, there will be a set of "default" permissions that the system will fallback on if permissions for the certain group and project don't exist.

For example, say we're looking at the project "MyForum" and we're logged in as a regular user, the permission system will check if we're allowed to create a new ticket by doing something like this:

// Fetch the permissions for the project and users group
Check if the permissions table contains a row with project_id of 1 and group_id of 3
Return permission set
Otherwise
Return permission set with project_id of 0 and group_id of 3

// Check if the user has permission to create a new ticket
if ($project->permission(current_user()->group_id, 'create_tickets')
// Show new ticket page.