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
c2187f61
Commit
c2187f61
authored
6 years ago
by
Tanner Prestegard
Committed by
GraceDB
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add settings variable for global control of unauthenticated access
parent
8deb0b25
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
config/settings/base.py
+10
-1
10 additions, 1 deletion
config/settings/base.py
with
10 additions
and
1 deletion
config/settings/base.py
+
10
−
1
View file @
c2187f61
...
...
@@ -16,6 +16,11 @@ BASE_DIR = abspath(join(dirname(__file__), "..", ".."))
CONFIG_ROOT
=
join
(
BASE_DIR
,
"
config
"
)
PROJECT_ROOT
=
join
(
BASE_DIR
,
"
gracedb
"
)
# Unauthenticated access ------------------------------------------------------
# This variable controls whether unauthenticated access is allowed *ANYWHERE*
# on this service, except the home page, which is always public.
UNAUTHENTICATED_ACCESS
=
True
# Miscellaneous settings ------------------------------------------------------
# Debug mode is off by default
DEBUG
=
False
...
...
@@ -379,9 +384,13 @@ REST_FRAMEWORK = {
'
EXCEPTION_HANDLER
'
:
'
api.exceptions.gracedb_exception_handler
'
,
'
DEFAULT_PERMISSION_CLASSES
'
:
(
'
rest_framework.permissions.IsAuthenticated
OrReadOnly
'
,
'
rest_framework.permissions.IsAuthenticated
'
,
)
}
# Change default permission classes based on UNAUTHENTICATED_ACCESS setting
if
UNAUTHENTICATED_ACCESS
is
True
:
REST_FRAMEWORK
[
'
DEFAULT_PERMISSION_CLASSES
'
]
=
\
(
'
rest_framework.permissions.IsAuthenticatedOrReadOnly
'
,)
# Location of packages installed by bower
BOWER_DIR
=
join
(
BASE_DIR
,
"
..
"
,
"
bower_components
"
)
...
...
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