diff --git a/navigation/index.js b/navigation/index.js index 9a543d0..f688b46 100644 --- a/navigation/index.js +++ b/navigation/index.js @@ -25,6 +25,25 @@ export default [ ], "meta": {} }, + { + "header": "RBAC", + "description": "", + "child": [ + { + "title": "Create User", + "path": "/create-user", + "icon": "", + "child": [] + }, + { + "title": "Permission", + "path": "/rbac-permission", + "icon": "", + "child": [] + } + ], + "meta": {} + }, { "header": "Pentadbiran", "description": "Urus aplikasi anda", diff --git a/pages/create-user/index.vue b/pages/create-user/index.vue new file mode 100644 index 0000000..e6520bf --- /dev/null +++ b/pages/create-user/index.vue @@ -0,0 +1,386 @@ + + + + + + + + + Create User + + + + + + + + + + Full Name * + + + {{ errors.fullName }} + + + + + + Username * + + + {{ errors.username }} + + + + + + Email Address * + + + {{ errors.email }} + + + + + + Phone Number * + + + {{ errors.phone }} + + + + + + + + + Password * + + + {{ errors.password }} + + + + + + Confirm Password * + + + {{ errors.confirmPassword }} + + + + + + + + + Multi-Factor Authentication (MFA) + + + + + + + Enable MFA + + Enhance account security with multi-factor authentication + + + + + + MFA Method + + + + + {{ method.label }} + + + + + + + + + + + + + + + + Reset + + + Creating... + Create User + + + + + + + + + \ No newline at end of file diff --git a/pages/rbac-permission/index.vue b/pages/rbac-permission/index.vue new file mode 100644 index 0000000..4d4b475 --- /dev/null +++ b/pages/rbac-permission/index.vue @@ -0,0 +1,1147 @@ + + + + + + + + + + Assign RBAC Permissions + Assign permissions to roles based on menus and components + + + + + + + Loading data... + + + + + + Group Selection + + + + Select Group * + + + + + Choose a group + + {{ role.name }} - {{ role.description }} + + + + + + + + + New Role + + + + {{ errors.roleId }} + + + + + + + + Create New Role + + + + + + + + + + + Role Name * + + + {{ roleErrors.name }} + + + + + Description * + + + {{ roleErrors.description }} + + + + + Cancel + + + Creating... + Create Role + + + + + + + + + + + Permissions + Select permissions by menu and component + + + + + + Add Permission + + + + {{ errors.permissions }} + + + + + + Permission #{{ index + 1 }} + + + + + + + + + + + + Menu * + + + + Select menu + + {{ menu.name }} + + + + + {{ errors[`permission_${index}_menu`] }} + + + + + + + Component * + + + + + + + + + + + + + + + + + {{ errors[`permission_${index}_component`] }} + + + Use letters, numbers, underscores (_), hyphens (-), or * for all components. No spaces allowed. + + + + + + This will apply to all components + + + + + + + + Actions * + + + + { + if (permission.actions.includes(action.value)) { + permission.actions = permission.actions.filter(a => a !== action.value) + } else { + permission.actions.push(action.value) + } + clearError(`permission_${index}_actions`) + }" + :class="[ + 'relative min-w-[100px] flex items-center justify-center h-[44px] px-4 text-sm font-medium transition-all duration-200', + 'focus:z-10 focus:outline-none focus:ring-2 focus:ring-blue-500', + permission.actions.includes(action.value) + ? 'bg-blue-50 text-blue-700 hover:bg-blue-100 border-blue-300' + : 'bg-white text-gray-700 hover:bg-gray-50 border-gray-300', + 'border', + // Round only the first and last buttons + actionIndex === 0 ? 'rounded-l-md' : '', + actionIndex === actionOptions.length - 1 ? 'rounded-r-md' : '', + // Add negative margin to overlap borders + actionIndex !== 0 ? '-ml-px' : '' + ]" + > + + + + + {{ action.label }} + + + + + + + + + + + + + + + + Preview: + {{ getMenuName(permission.menuName) }} → {{ getComponentDisplayName(permission.componentName) }} → + + + + + + {{ action }} + + + + + + + + + + + + + Assign Users + Add users to this role group + + + + + + + + Search Users + + + + + + + + + Available Users + + + + {{ user.name }} + {{ user.email }} + + {{ user.department }} + + + + Add + + + + All users have been assigned + + + No users found matching your search + + + + + + + Assigned Users + + + + {{ user.name }} + {{ user.email }} + + {{ user.department }} + + + + Remove + + + + No users assigned yet + + + + + + + + + Assignment Summary + + Role: {{ getRoleName(formData.roleId) }} + + + + + Permissions: + + + + + {{ getMenuName(permission.menuName) }} → + {{ getComponentDisplayName(permission.componentName) }} + + + {{ action }} + + + + + + + + + + + Assigned Users: + + + {{ user.name }} ({{ user.department }}) + + + + + + + + + Reset + + + Assigning... + Assign Permissions + + + + + + + + + \ No newline at end of file
{{ errors.fullName }}
{{ errors.username }}
{{ errors.email }}
{{ errors.phone }}
{{ errors.password }}
{{ errors.confirmPassword }}
Enhance account security with multi-factor authentication
Assign permissions to roles based on menus and components
{{ errors.roleId }}
{{ roleErrors.name }}
{{ roleErrors.description }}
Select permissions by menu and component
{{ errors.permissions }}
+ {{ errors[`permission_${index}_menu`] }} +
+ {{ errors[`permission_${index}_component`] }} +
+ Use letters, numbers, underscores (_), hyphens (-), or * for all components. No spaces allowed. +
+ + + + This will apply to all components +
+ Preview: + {{ getMenuName(permission.menuName) }} → {{ getComponentDisplayName(permission.componentName) }} → + + + + + + {{ action }} + + +
Add users to this role group
{{ user.name }}
{{ user.email }}
+ Role: {{ getRoleName(formData.roleId) }} +
Permissions:
Assigned Users: