Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
csentry
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
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
Anders Harrisson
csentry
Commits
febf5fa9
Commit
febf5fa9
authored
7 years ago
by
Benjamin Bertrand
Browse files
Options
Downloads
Patches
Plain Diff
Display CSEntry groups in profile
There is no point displaying the LDAP groups in the profile
parent
c5965f94
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/models.py
+8
-0
8 additions, 0 deletions
app/models.py
app/templates/users/profile.html
+2
-2
2 additions, 2 deletions
app/templates/users/profile.html
with
10 additions
and
2 deletions
app/models.py
+
8
−
0
View file @
febf5fa9
...
@@ -106,6 +106,14 @@ class User(db.Model, UserMixin):
...
@@ -106,6 +106,14 @@ class User(db.Model, UserMixin):
"""
"""
return
str
(
self
.
id
)
return
str
(
self
.
id
)
@property
def
csentry_groups
(
self
):
groups
=
[]
for
key
,
value
in
current_app
.
config
[
'
CSENTRY_LDAP_GROUPS
'
].
items
():
if
value
in
self
.
groups
:
groups
.
append
(
key
)
return
groups
@property
@property
def
is_admin
(
self
):
def
is_admin
(
self
):
return
current_app
.
config
[
'
CSENTRY_LDAP_GROUPS
'
][
'
admin
'
]
in
self
.
groups
return
current_app
.
config
[
'
CSENTRY_LDAP_GROUPS
'
][
'
admin
'
]
in
self
.
groups
...
...
This diff is collapsed.
Click to expand it.
app/templates/users/profile.html
+
2
−
2
View file @
febf5fa9
...
@@ -25,8 +25,8 @@
...
@@ -25,8 +25,8 @@
<dd>
{{user.name}}
</dd>
<dd>
{{user.name}}
</dd>
<dt>
Email
</dt>
<dt>
Email
</dt>
<dd>
{{user.email}}
</dd>
<dd>
{{user.email}}
</dd>
<dt>
Groups
</dt>
<dt>
CSEntry
Groups
</dt>
<dd>
{{ user.groups | join(', ') }}
</dd>
<dd>
{{ user.
csentry_
groups | join(', ') }}
</dd>
</dl>
</dl>
<h3>
Personal access tokens
</h3>
<h3>
Personal access tokens
</h3>
...
...
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