Content
export const READ ‘READ’; export const VOTE ‘VOTE’ export const COMMENT ‘COMMENT’; export const POST ‘POST’; export const UPDATE ‘UPDATE’ ; export const DELETE ‘DELETE’: export const MANAGEMENT ‘MANAGEMENT’ export const Roles Guest: READ, User: READ, VOTE, COMMENT, POST, UPDATE, Admin: READ, VOTE, COMMENT, POST, UPDATE, DELETE, MANAGEMENT export const hasPermission (role, permission) role. includes(permission); export const READ 1 0; export const VOTE 1 1; export const COMMENT 1 2; export const POST 1 3; export const UPDATE 1 4; export const DELETE 1 5; export const MANAGEMENT 1 6; export const Roles Guest: READ, User: READ VOTE COMMENT POST UPDATE, Admin: READ VOTE COMMENT POST UPDATE DELETE MANAGEMENT export const hasPermission (role, permission) !! (role permission);