Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GraceDB Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michael William Coughlin
GraceDB Server
Commits
43b683b2
Commit
43b683b2
authored
6 years ago
by
Tanner Prestegard
Committed by
GraceDB
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add decorator for LV-EM only access
parent
8cee1ae4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gracedb/ligoauth/decorators.py
+23
-0
23 additions, 0 deletions
gracedb/ligoauth/decorators.py
gracedb/templates/ligoauth/manage_password.html
+0
-0
0 additions, 0 deletions
gracedb/templates/ligoauth/manage_password.html
with
23 additions
and
0 deletions
gracedb/ligoauth/decorators.py
+
23
−
0
View file @
43b683b2
...
...
@@ -25,3 +25,26 @@ def internal_user_required(function=None, raise_exception=True, **kwargs):
if
function
:
return
actual_decorator
(
function
)
return
actual_decorator
def
lvem_observers_only
(
function
=
None
,
login_url
=
None
,
superuser_allowed
=
False
,
raise_exception
=
True
):
"""
Allow access only to non-LVC LV-EM observers
"""
def
check_groups
(
user
):
in_lvem_obs
=
user
.
groups
.
filter
(
name
=
settings
.
LVEM_OBSERVERS_GROUP
).
exists
()
in_lvc
=
user
.
groups
.
filter
(
name
=
settings
.
LVC_GROUP
).
exists
()
if
((
in_lvem_obs
and
not
in_lvc
)
or
(
superuser_allowed
and
user
.
is_superuser
)):
return
True
if
raise_exception
:
raise
PermissionDenied
return
False
actual_decorator
=
user_passes_test
(
check_groups
,
login_url
=
login_url
)
if
function
:
return
actual_decorator
(
function
)
return
actual_decorator
This diff is collapsed.
Click to expand it.
gracedb/templates/
profile
/manage_password.html
→
gracedb/templates/
ligoauth
/manage_password.html
+
0
−
0
View file @
43b683b2
File moved
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment