Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add permission declarations for queues and light edges (SYN-8959, SYN-8973) #4214

Merged
merged 2 commits into from
Mar 28, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changes/116c175a74bfbfefae62a705b3d7fe32.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
desc: Added missing permission declarations for light edges and queues.
prs: []
type: bug
...
10 changes: 10 additions & 0 deletions synapse/cortex.py
Original file line number Diff line number Diff line change
Expand Up @@ -1397,6 +1397,16 @@ def _initCorePerms(self):
{'perm': ('node', 'del', '<form>'), 'gate': 'layer',
'desc': 'Controls removing a specific form of node in a layer.'},

{'perm': ('node', 'edge', 'add'), 'gate': 'layer',
'desc': 'Controls adding light edges to a node.'},
{'perm': ('node', 'edge', 'del'), 'gate': 'layer',
'desc': 'Controls adding light edges to a node.'},

{'perm': ('node', 'edge', 'add', '<verb...>'), 'gate': 'layer',
'desc': 'Controls adding a specific light edge to a node.'},
{'perm': ('node', 'edge', 'del', '<verb...>'), 'gate': 'layer',
'desc': 'Controls adding a specific light edge to a node.'},

{'perm': ('node', 'tag'), 'gate': 'layer',
'desc': 'Controls editing any tag on any node in a layer.'},
{'perm': ('node', 'tag', 'add'), 'gate': 'layer',
Expand Down
10 changes: 10 additions & 0 deletions synapse/lib/stormtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3933,6 +3933,16 @@ class LibQueue(Lib):
'returns': {'type': 'list',
'desc': 'A list of queue definitions the current user is allowed to interact with.', }}},
)
_storm_lib_perms = (
{'perm': ('queue', 'add'), 'gate': 'cortex',
'desc': 'Permits a user to create a named queue.'},
{'perm': ('queue', 'get'), 'gate': 'queue',
'desc': 'Permits a user to access a queue. This allows the user to read from the queue and remove items from it.'},
{'perm': ('queue', 'put'), 'gate': 'queue',
'desc': 'Permits a user to put items into a queue.'},
{'perm': ('cron', 'del'), 'gate': 'queue',
'desc': 'Permits a user to delete a queue.'},
)
_storm_lib_path = ('queue',)

def getObjLocals(self):
Expand Down