Web Component: j-PermissionsOP
j-Permissions for OpenPlatform applications
The component is similar like j-Permissions
, but this component is more developer friendly (more automated) and it's targeted for OpenPlatform applications. The component generates output in the form:
['C@admin', 'W@admin', 'R@admin', 'D@admin', 'R123456', 'R#employees']
- first letter means allowed type, defined in
types
@admin
means a roleadmin
#employees
means a groupemployees
123456
means a specificuserid
Configuration:
placeholder
{String} a placeholder forj-Directory
component (default:Search
)types
{String} types of permission (array delimited by char, default:CRUD
)dirsource
{String} a link to method, it is evaluated after user clicks on the headerpk
{String} apk
means primary key, it's used as a prevention for duplicated values (default:name
)disabled
{Boolean} optional, disables this componentdefault
{String} default value oftype
(default:R
)dirraw
{Boolean} optional, can disable HTML encoding for text inj-Directory
(default:false
)dirkey
{String} optional, a key for text inj-Directory
(default:name
)labelrole
{String} optional a label for roles (default:Role
)labelgroup
{String} optional a label for groups (default:Group
)limit
{Number} a count of allowed permissions (default:0
= unlimited)pk
{String} a primary key which value will be binded into the model (default:id
)- IMPORTANT
find
{String} URL address for finding roles, groups and users, the component sendsurl?q=SEARCH_QUERY
(it sends empty value) - IMPORTANT
read
{String} URL address for reading roles, groups and users, the component sendsurl?id=@role,#group,userid,...
// The component expects data:
['C@admin', 'W@admin', 'R@admin', 'D@admin', 'R123456', 'R#employees'];
// The component tries to find data:
// The component tries to read data and it pairs them with the model automatically:
[{ id: '123456', name: 'Peter Širka' }, { id: '@admin', name: 'Administrators' }, { id: '#employees', name: 'Employees' }];
Author
- Peter Širka petersirka@gmail.com
- License
Created
29. september 2019
Updated
01. february 2023
Version
v1
License
https://www.totaljs.com/license/
Dark mode
Yes
Responsive
Yes
Author
Peter Širka
Email
petersirka@gmail.com