chore: Custom Roles to manage permissions [ UI ] (#9865)
In admin settings, this Pr will add the UI for managing custom roles ( ref: https://github.com/chatwoot/chatwoot/pull/9995 ). It also handles the routing logic changes to accommodate fine-tuned permissions. --------- Co-authored-by: Pranav <pranavrajs@gmail.com> Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Co-authored-by: iamsivin <iamsivin@gmail.com> Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
@@ -42,6 +42,26 @@ describe('#getters', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('#getCurrentCustomRoleId', () => {
|
||||
it('returns current custom role id', () => {
|
||||
expect(
|
||||
getters.getCurrentCustomRoleId(
|
||||
{ currentUser: { accounts: [{ id: 1, custom_role_id: 1 }] } },
|
||||
{ getCurrentAccountId: 1 }
|
||||
)
|
||||
).toEqual(1);
|
||||
});
|
||||
|
||||
it('returns undefined if account is not available', () => {
|
||||
expect(
|
||||
getters.getCurrentCustomRoleId(
|
||||
{ currentUser: { accounts: [{ id: 1, custom_role_id: 1 }] } },
|
||||
{ getCurrentAccountId: 2 }
|
||||
)
|
||||
).toEqual(undefined);
|
||||
});
|
||||
});
|
||||
|
||||
describe('#getCurrentUserAvailability', () => {
|
||||
it('returns correct availability status', () => {
|
||||
expect(
|
||||
|
||||
Reference in New Issue
Block a user