Skip to content

Commit

Permalink
add principal acl to example
Browse files Browse the repository at this point in the history
  • Loading branch information
rnixx committed May 17, 2024
1 parent 8e75709 commit 2fcbfab
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 50 deletions.
6 changes: 6 additions & 0 deletions examples/cone.example/example.ini
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ cone.root.default_child = example
#cone.root.default_content_tile =
#cone.root.mainmenu_empty_title = false

ugm.backend = file
ugm.users_file = $(here)/var/ugm/users
ugm.groups_file = $(here)/var/ugm/groups
ugm.roles_file = $(here)/var/ugm/roles
ugm.datadir = $(here)/var/ugm/data

[pipeline:main]
pipeline =
example
46 changes: 0 additions & 46 deletions examples/cone.example/i18n.sh

This file was deleted.

4 changes: 2 additions & 2 deletions examples/cone.example/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
include_package_data=True,
zip_safe=False,
install_requires=[
'waitress',
'cone.app'
'cone.app',
'waitress'
]
)
11 changes: 10 additions & 1 deletion examples/cone.example/src/cone/example/model.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
from cone.app.model import BaseNode
from cone.app.security import PrincipalACL
from plumber import plumbing


@plumbing(PrincipalACL)
class ExamplePlugin(BaseNode):
pass

@property
def principal_roles(self):
return dict(
max=['manager'],
sepp=['editor']
)
1 change: 1 addition & 0 deletions examples/cone.example/var/ugm/data/admin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fullname:Admin
1 change: 1 addition & 0 deletions examples/cone.example/var/ugm/data/max
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fullname:Max
1 change: 1 addition & 0 deletions examples/cone.example/var/ugm/data/sepp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fullname:Sepp
Empty file.
3 changes: 3 additions & 0 deletions examples/cone.example/var/ugm/roles
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
admin::manager
max::editor
sepp::viewer
3 changes: 3 additions & 0 deletions examples/cone.example/var/ugm/users
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
admin:DTH11mwkW4ty9Jcer2CeGhqlX63whH6Nhi4MSi6V4im0xTdRs58Hwg==
max:hBVsuSCk67/zcfxGcljarlwM66s0WcAoRtqCOfd0R16n5weEvvcHPg==
sepp:6P+q3xCly0ikwT3cmDDIvhHAp0fjkRfy2knx6BJEExOodLumMtcNpA==
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"qunit": "^2.19.4",
"rollup": "^2.79.1",
"rollup-plugin-cleanup": "^3.2.1",
"sass": "^1.76.0"
"sass": "^1.77.2"
}
}

0 comments on commit 2fcbfab

Please sign in to comment.