Allows access control permissions to be defined per action and user (by session_id); maintains a record of session_ids and associated role.
Allows access control permissions to be defined per action and user (by session_id);
maintains a record of session_ids and associated role.
^2.0.0
This package enables granular control over permissions for actions performed by users within the system. Permissions can be finely tuned based on specific session IDs or logically-defined groups of sessions. It maintains permission configurations and roles tied explicitly to each user session. The action type is configured as a singleton, ensuring only one active instance exists at any given time to guarantee consistency in permission checks throughout the platform.
Below is detailed guidance on how to configure the access control permissions.
The access control configuration allows you to specify permissions along multiple dimensions, enabling or restricting specific actions based on:
"any"
)The configuration consists of three primary components:
permissions
Defines the allow or deny settings for channels, resources, actions, or default rules.
permissions = {
"channel": { # Example: "default", "whatsapp", "sms"
"resource/action": { # Specific action/resource or default to "any"
"deny": [], # List restricted session_ids, session_groups, or keyword "all"
"allow": [] # List allowed session_ids, session_groups, or keyword "all"
}
}
}
"any"
applies rules as default across all undefined specific actions/resources."all"
conveniently refers to all sessions/users.session_groups
Define logical collections of session IDs for easier permission management.
session_groups = {
"admins": ["session123", "session456"],
"support_team": ["session789", "session101"]
}
exceptions
Define actions exempted from permissions checks and allowed unrestricted access.
exceptions = ["action_name", "another_action_name"]
If listed, these actions ignore any permissions limitation configured within the permissions
block.
permissions = {
"default": {
"any": {
"deny": [],
"allow": ["all"]
}
}
}
permissions = {
"default": {
"delete_resource": {
"deny": ["all"],
"allow": ["admins"]
}
}
}
session_groups = {
"admins": ["session_id_1", "session_id_2"]
}
permissions = {
"whatsapp": {
"send_message": {
"deny": ["all"],
"allow": ["session_xyz"]
}
}
}
exceptions = ["system_healthcheck"]
The above example shows that permission limitations will not apply to the specified "system_healthcheck"
action.
session_groups
to simplify permission management at scale."any"
) before fine-tuning for specific actions.exceptions
minimal to maintain security and integrity.After updating the configuration (permissions
, session_groups
, exceptions
):
"any"
, "all"
)."deny"
permissions always override allowed ones when permission conflicts arise.Properly configuring permissions using the Access Control Action ensures your platform remains secure by restricting actions based on clearly defined, configurable rules. It provides a robust mechanism to address diverse security and operational needs across users, actions, and communication channels.
access_control_action
project.git clone https://github.com/TrueSelph/access_control_action
git checkout -b new-feature-x
git commit -m 'Implemented new feature x.'
git push origin new-feature-x
This project is protected under the Apache License 2.0. See LICENSE for more information.
jvcli download action jivas/access_control_action
Last published
3 months ago
Version
0.0.1
Downloads
168
Author
jivasType
action
Visibility
Public
Tags