Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-Core
Commits
ab6116aa
Verified
Commit
ab6116aa
authored
4 years ago
by
Tom Teichler
Browse files
Options
Downloads
Patches
Plain Diff
Add first permissions for person object
parent
b7d54702
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!207
Resolve "Roles and permissions"
Pipeline
#1416
failed
4 years ago
Stage: test
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aleksis/core/models.py
+4
-0
4 additions, 0 deletions
aleksis/core/models.py
aleksis/core/templates/core/person_full.html
+27
-21
27 additions, 21 deletions
aleksis/core/templates/core/person_full.html
with
31 additions
and
21 deletions
aleksis/core/models.py
+
4
−
0
View file @
ab6116aa
...
...
@@ -95,6 +95,10 @@ class Person(ExtensibleModel):
ordering
=
[
"
last_name
"
,
"
first_name
"
]
verbose_name
=
_
(
"
Person
"
)
verbose_name_plural
=
_
(
"
Persons
"
)
permissions
=
(
(
"
see_address
"
,
_
(
"
Can see address
"
)),
(
"
see_contact_details
"
,
_
(
"
Can see contact details
"
)),
)
icon_
=
"
person
"
...
...
This diff is collapsed.
Click to expand it.
aleksis/core/templates/core/person_full.html
+
27
−
21
View file @
ab6116aa
...
...
@@ -2,7 +2,7 @@
{% extends "core/base.html" %}
{% load i18n static cropping rules %}
{% load i18n static cropping
guardian_tags
rules %}
{% load render_table from django_tables2 %}
{% block browser_title %}{{ person.first_name }} {{ person.last_name }}{% endblock %}
...
...
@@ -10,6 +10,8 @@
{% block content %}
<h4>
{{ person.first_name }} {{ person.last_name }}
</h4>
{% get_obj_perms request.user for person as "person_perms" %}
{% has_perm 'core.change_person' user person as can_change_person %}
{% if can_change_person %}
<p>
...
...
@@ -50,26 +52,30 @@
</td>
<td
colspan=
"3"
>
{{ person.get_sex_display }}
</td>
</tr>
<tr>
<td>
<i
class=
"material-icons small"
>
home
</i>
</td>
<td
colspan=
"2"
>
{{ person.street }} {{ person.housenumber }}
</td>
<td
colspan=
"2"
>
{{ person.postal_code }} {{ person.place }}
</td>
</tr>
<tr>
<td>
<i
class=
"material-icons small"
>
phone
</i>
</td>
<td>
{{ person.phone_number }}
</td>
<td>
{{ person.mobile_number }}
</td>
</tr>
<tr>
<td>
<i
class=
"material-icons small"
>
email
</i>
</td>
<td
colspan=
"3"
>
{{ person.email }}
</td>
</tr>
{% if "see_address" in person_perms %}
<tr>
<td>
<i
class=
"material-icons small"
>
home
</i>
</td>
<td
colspan=
"2"
>
{{ person.street }} {{ person.housenumber }}
</td>
<td
colspan=
"2"
>
{{ person.postal_code }} {{ person.place }}
</td>
</tr>
{% endif %}
{% if "see_contact_details" in person_perms %}
<tr>
<td>
<i
class=
"material-icons small"
>
phone
</i>
</td>
<td>
{{ person.phone_number }}
</td>
<td>
{{ person.mobile_number }}
</td>
</tr>
<tr>
<td>
<i
class=
"material-icons small"
>
email
</i>
</td>
<td
colspan=
"3"
>
{{ person.email }}
</td>
</tr>
{% endif %}
<tr>
<td>
<i
class=
"material-icons small"
>
cake
</i>
...
...
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