mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 02:42:26 -05:00
Review comments fixed. All tests passing.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from flask.ext.login import (UserMixin, login_fresh)
|
||||
from flask import session
|
||||
|
||||
|
||||
class User(UserMixin):
|
||||
@@ -81,7 +82,9 @@ class User(UserMixin):
|
||||
def permissions(self, permissions):
|
||||
raise AttributeError("Read only property")
|
||||
|
||||
def has_permissions(self, service_id, permissions, or_=False):
|
||||
def has_permissions(self, permissions, service_id=None, or_=False):
|
||||
if service_id is None:
|
||||
service_id = session.get('service_id', '')
|
||||
if service_id in self._permissions:
|
||||
if or_:
|
||||
return any([x in self._permissions[service_id] for x in permissions])
|
||||
|
||||
Reference in New Issue
Block a user