https://github.com/miniscruff/scopie-py
Python implementation of scopie
https://github.com/miniscruff/scopie-py
Last synced: 5 months ago
JSON representation
Python implementation of scopie
- Host: GitHub
- URL: https://github.com/miniscruff/scopie-py
- Owner: miniscruff
- License: mit
- Created: 2024-01-07T23:33:20.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-11-22T03:58:30.000Z (8 months ago)
- Last Synced: 2025-11-22T05:36:45.347Z (8 months ago)
- Language: Python
- Homepage: https://scopie-py.readthedocs.io
- Size: 42 KB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Scopie-py
[](https://pypi.org/project/scopie/)
[](https://scopie-py.readthedocs.io/en/stable/)
Python implementation of [scopie](https://github.com/miniscruff/scopie).
```python
from scopie import is_allowed
users = {
"elsa": {
"permissions": ["allow:blog/create|update"],
},
"bella": {
"permissions": ["allow:blog/create"],
},
}
blogPosts = {}
def create_blog(username, blogSlug, blogContent):
user = users[username]
if is_allowed(["blog/create"], user["permissions"]):
blogPosts[blogSlug] = {
"author": user,
"content": blogContent,
}
def update_blog(username, blogSlug, blogContent):
user = users[username]
if is_allowed(["blog/update"], user["permissions"]):
blogPosts[blogSlug] = {
"author": user,
"content": blogContent,
}
```