mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-16 20:49:00 -04:00
Allow users to navigate folders when copying
We already have a pattern for navigation folders and searching for templates – let’s use it for the copy page too. And I reckon we can represent services as folders if the user has multiple services they could copy a template from.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from itertools import chain
|
||||
|
||||
from flask import request, session
|
||||
from flask import abort, request, session
|
||||
from flask_login import AnonymousUserMixin, UserMixin
|
||||
|
||||
from app.utils import is_gov_user
|
||||
@@ -151,6 +151,10 @@ class User(UserMixin):
|
||||
def has_permission_for_service(self, service_id, permission):
|
||||
return permission in self._permissions.get(service_id, [])
|
||||
|
||||
def belongs_to_service_or_403(self, service_id):
|
||||
if str(service_id) not in self.services:
|
||||
abort(403)
|
||||
|
||||
def is_locked(self):
|
||||
return self.failed_login_count >= self.max_failed_login_count
|
||||
|
||||
|
||||
Reference in New Issue
Block a user