Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SCODOC_R6A06
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Paul Milleville
SCODOC_R6A06
Commits
07423e08
Commit
07423e08
authored
8 months ago
by
Emmanuel Viennet
Browse files
Options
Downloads
Patches
Plain Diff
CAS: change sémantique param. cas_allow_scodoc_login
parent
815d5a71
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
app/auth/cas.py
+1
-1
1 addition, 1 deletion
app/auth/cas.py
app/auth/models.py
+6
-4
6 additions, 4 deletions
app/auth/models.py
app/scodoc/sco_import_users.py
+1
-1
1 addition, 1 deletion
app/scodoc/sco_import_users.py
app/views/users.py
+1
-1
1 addition, 1 deletion
app/views/users.py
with
9 additions
and
7 deletions
app/auth/cas.py
+
1
−
1
View file @
07423e08
...
...
@@ -158,7 +158,7 @@ CAS_USER_INFO_COMMENTS = (
autorise la connexion via CAS (optionnel, faux par défaut)
"""
,
"""
cas_allow_scodoc_login
autorise connexion via ScoDoc même si CAS
obligatoire
(optionnel,
faux
par défaut)
autorise connexion via ScoDoc même si CAS
activé
(optionnel,
vrai
par défaut)
"""
,
"""
email_institutionnel
optionnel, le mail officiel de l
'
utilisateur.
...
...
This diff is collapsed.
Click to expand it.
app/auth/models.py
+
6
−
4
View file @
07423e08
...
...
@@ -92,7 +92,7 @@ class User(UserMixin, ScoDocModel):
cas_allow_scodoc_login
=
db
.
Column
(
db
.
Boolean
,
default
=
False
,
server_default
=
"
false
"
,
nullable
=
False
)
"""
Si CAS
forcé (cas_force)
, peut-on se logguer sur ScoDoc directement ?
"""
Si CAS
activé et cas_id renseigné
, peut-on se logguer sur ScoDoc directement ?
(le rôle ScoSuperAdmin peut toujours, mettre à True pour les utilisateur API)
"""
cas_last_login
=
db
.
Column
(
db
.
DateTime
,
nullable
=
True
)
...
...
@@ -211,10 +211,12 @@ class User(UserMixin, ScoDocModel):
send_notif_desactivation_user
(
self
)
return
False
# if CAS activated and
force
d, allow only super-user and users with cas_allow_scodoc_login
# if CAS activated and
cas_i
d, allow only super-user and users with cas_allow_scodoc_login
cas_enabled
=
ScoDocSiteConfig
.
is_cas_enabled
()
if
cas_enabled
and
ScoDocSiteConfig
.
get
(
"
cas_force
"
):
if
(
not
self
.
is_administrator
())
and
not
self
.
cas_allow_scodoc_login
:
if
cas_enabled
:
if
ScoDocSiteConfig
.
get
(
"
cas_force
"
)
and
not
self
.
is_administrator
():
return
False
# si CAS forcé, n'accepte que super-admin
if
self
.
cas_id
and
not
self
.
cas_allow_scodoc_login
:
return
False
if
not
self
.
password_hash
:
# user without password can't login
...
...
This diff is collapsed.
Click to expand it.
app/scodoc/sco_import_users.py
+
1
−
1
View file @
07423e08
...
...
@@ -85,7 +85,7 @@ COMMENTS = (
autorise la connexion via CAS (optionnel, faux par défaut)
"""
,
"""
cas_allow_scodoc_login
autorise connexion via ScoDoc même si CAS
obligatoire
(optionnel, faux par défaut)
autorise connexion via ScoDoc même si CAS
activé
(optionnel, faux par défaut)
"""
,
"""
email_institutionnel
optionnel, le mail officiel de l
'
utilisateur.
...
...
This diff is collapsed.
Click to expand it.
app/views/users.py
+
1
−
1
View file @
07423e08
...
...
@@ -452,7 +452,7 @@ def create_user_form(user_name=None, edit=0, all_roles=True):
{
"
title
"
:
"
Autorise connexion via ScoDoc
"
,
"
input_type
"
:
"
boolcheckbox
"
,
"
explanation
"
:
"""
même si
"
Forcer l
'
utilisation de
CAS
"
est activé.
"
explanation
"
:
"""
même si CAS est activé
et cas_id renseigné
.
Seul le super-administrateur peut changer ce réglage
"""
,
"
enabled
"
:
current_user
.
is_administrator
(),
},
...
...
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