assembl.models.permissions module¶
All classes relative to permissions.
-
class
assembl.models.permissions.
AbstractLocalUserRole
(**kwargs)[source]¶ Bases:
assembl.models.DiscussionBoundBase
,assembl.lib.sqla.PrivateObjectMixin
-
class
assembl.models.permissions.
DiscussionPermission
(**kwargs)[source]¶ Bases:
assembl.models.DiscussionBoundBase
Which permissions are given to which roles for a given discussion.
-
class
assembl.models.permissions.
LocalUserRole
(**kwargs)[source]¶ Bases:
assembl.models.permissions.AbstractLocalUserRole
The role that a user has in the context of a discussion
-
classmethod
base_conditions
(alias=None, alias_maker=None)[source]¶ Return a list of SQLA expressions that will filter out instances of this class
Mostly used to exclude archived versions; see
assembl.lib.history_mixin
The exclusion pattern is used by the traversal API, and by the RDF mapping.
-
classmethod
get_discussion_conditions
(discussion_id, alias_maker=None)[source]¶ Returns a list of SQLA expressions that constrain a query on this class to a given discussion.
-
classmethod
special_quad_patterns
(alias_maker, discussion_id)[source]¶ Returns a list of quad map patterns for RDF mapping, beyond those defined by introspection.
Important: If defined somewhere, override in subclasses to avoid inheritance.
-
unique_query
()[source]¶ returns a couple (query, usable), with a sqla query for conflicting similar objects. usable is true if the query has to be enforced; sometimes it makes sense to return un-usable query that will be used to construct queries of subclasses. Note that when a duplicate is found, you’ll often want to expunge the original.
-
classmethod
-
class
assembl.models.permissions.
Permission
(**kwargs)[source]¶ Bases:
assembl.models.NamedClassMixin
,sqlalchemy.ext.declarative.api.Base
A permission that a user may have
-
class
assembl.models.permissions.
Role
(**kwargs)[source]¶ Bases:
assembl.models.NamedClassMixin
,sqlalchemy.ext.declarative.api.Base
A role that a user may have in a discussion
-
class
assembl.models.permissions.
UserRole
(**kwargs)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Base
,assembl.lib.sqla.PrivateObjectMixin
roles that a user has globally (eg admin.)
-
class
assembl.models.permissions.
UserTemplate
(**kwargs)[source]¶ Bases:
assembl.models.DiscussionBoundBase
,assembl.models.auth.User
A fake user with default permissions and Notification Subscriptions.
-
classmethod
get_applicable_notification_subscriptions_classes
()[source]¶ The classes of notifications subscriptions that make sense to put in a template user.
Right now, that is all concrete classes that are global to the discussion.
-
classmethod
get_discussion_conditions
(discussion_id, alias_maker=None)[source]¶ Returns a list of SQLA expressions that constrain a query on this class to a given discussion.
-
classmethod