Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
djangoldp-account
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
djangoldp-packages
djangoldp-account
Commits
8200f9dd
Commit
8200f9dd
authored
6 years ago
by
Jean-Baptiste
Browse files
Options
Downloads
Patches
Plain Diff
syntax: Explicit AnonymousReadOnly permission
parent
691fe895
Loading
Loading
No related merge requests found
Pipeline
#369
passed
6 years ago
Stage: test
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
djangoldp_account/models.py
+3
-5
3 additions, 5 deletions
djangoldp_account/models.py
djangoldp_account/urls.py
+6
-5
6 additions, 5 deletions
djangoldp_account/urls.py
with
9 additions
and
10 deletions
djangoldp_account/models.py
+
3
−
5
View file @
8200f9dd
from
django.db
import
models
from
django.contrib.auth.models
import
User
from
django.
core.urlresolvers
import
reverse_lazy
from
django.
db
import
models
class
Account
(
models
.
Model
):
...
...
@@ -8,6 +7,7 @@ class Account(models.Model):
picture
=
models
.
URLField
(
blank
=
True
,
null
=
True
)
class
Meta
:
auto_author
=
'
user
'
permissions
=
(
(
'
view_account
'
,
'
Read
'
),
(
'
control_account
'
,
'
Control
'
),
...
...
@@ -22,6 +22,7 @@ class ChatProfile(models.Model):
jabberID
=
models
.
CharField
(
max_length
=
255
,
blank
=
True
,
null
=
True
)
class
Meta
:
auto_author
=
'
user
'
permissions
=
(
(
'
view_chatprofile
'
,
'
Read
'
),
(
'
control_chatprofile
'
,
'
Control
'
),
...
...
@@ -29,6 +30,3 @@ class ChatProfile(models.Model):
def
__str__
(
self
):
return
'
{} (jabberID: {})
'
.
format
(
self
.
user
.
get_full_name
(),
self
.
jabberID
)
This diff is collapsed.
Click to expand it.
djangoldp_account/urls.py
+
6
−
5
View file @
8200f9dd
...
...
@@ -5,6 +5,7 @@ from django.conf import settings
from
django.conf.urls
import
url
,
include
from
django.contrib.auth.models
import
Group
from
djangoldp.views
import
LDPViewSet
from
djangoldp.permissions
import
AnonymousReadOnly
from
.models
import
ChatProfile
,
Account
from
.views
import
userinfocustom
...
...
@@ -21,12 +22,12 @@ for dldp_module in djangoldp_modules:
pass
urlpatterns
=
[
url
(
r
'
^groups/
'
,
LDPViewSet
.
urls
(
model
=
Group
,
fields
=
[
'
@id
'
,
'
name
'
,
'
user_set
'
])),
url
(
r
'
^users/
'
,
LDPViewSet
.
urls
(
model
=
settings
.
AUTH_USER_MODEL
,
fields
=
user_fields
,
permission_classes
=
[],
nested_fields
=
user_nested_fields
)),
url
(
r
'
^groups/
'
,
LDPViewSet
.
urls
(
model
=
Group
,
fields
=
[
'
@id
'
,
'
name
'
,
'
user_set
'
]
,
permission_classes
=
[
AnonymousReadOnly
]
)),
url
(
r
'
^users/
'
,
LDPViewSet
.
urls
(
model
=
settings
.
AUTH_USER_MODEL
,
fields
=
user_fields
,
permission_classes
=
[
AnonymousReadOnly
],
nested_fields
=
user_nested_fields
)),
url
(
r
'
^accounts/
'
,
include
(
'
django.contrib.auth.urls
'
)),
url
(
r
'
^accounts/
'
,
LDPViewSet
.
urls
(
model
=
Account
)),
url
(
r
'
^chat-profile/
'
,
LDPViewSet
.
urls
(
model
=
ChatProfile
)),
url
(
r
'
^accounts/
'
,
LDPViewSet
.
urls
(
model
=
Account
,
permission_classes
=
[
AnonymousReadOnly
]
)),
url
(
r
'
^chat-profile/
'
,
LDPViewSet
.
urls
(
model
=
ChatProfile
,
permission_classes
=
[
AnonymousReadOnly
]
)),
url
(
r
'
^openid/userinfo
'
,
userinfocustom
),
url
(
r
'
^openid/
'
,
include
(
'
oidc_provider.urls
'
,
namespace
=
'
oidc_provider
'
)),
]
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