Browse files

remove models

We don't want to define app specific models in a library
  • Loading branch information...
1 parent e0c5e3a commit 8d9010dc2540e18d9ccb7aadabd4c171e10af98a @reedobrien reedobrien committed Dec 10, 2012
Showing with 0 additions and 40 deletions.
  1. +0 −1 lumin/models/__init__.py
  2. +0 −39 lumin/models/user.py
View
1 lumin/models/__init__.py
@@ -1 +0,0 @@
-## a package
View
39 lumin/models/user.py
@@ -1,39 +0,0 @@
-from pyramid.security import authenticated_userid
-from pyramid.security import Allow
-from pyramid.security import Everyone
-from pyramid.security import has_permission
-
-from lumin.node import ContextById
-from lumin.node import Collection
-
-
-class UserManagement(Collection):
- __acl__ = (
- [Allow, Everyone, 'join'],
- [Allow, 'group:managers', ['add', 'manage', 'delete']],
- )
-
- collection = 'users'
-
- def get(self, _id):
- return User(self.request, _id=_id)
-
-
-class User(ContextById):
- _default__acl__ = [
- [Allow, 'group:managers', ['view', 'edit', 'delete', 'manage', 'add']],
- ]
-
- collection = 'users'
-
- def __init__(self, request, **kwargs):
- super(User, self).__init__(request, **kwargs)
-
- if self._id == authenticated_userid(request):
- permissions = tuple(
- permission for permission in ('view', 'edit') if
- not has_permission(permission, self, request)
- )
-
- if permissions:
- self.add_ace([Allow, self._id, list(permissions)])

0 comments on commit 8d9010d

Please sign in to comment.