Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
cfe9fd31
Commit
cfe9fd31
authored
Dec 17, 2014
by
Gergely Ujvari
Committed by
ujvari
Jan 15, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move group:__world__ to a constant
parent
18166dbe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
permissions-service.coffee
h/static/scripts/permissions-service.coffee
+6
-3
No files found.
h/static/scripts/permissions-service.coffee
View file @
cfe9fd31
###*
# @ngdoc service
# @name Permissions
...
...
@@ -7,6 +8,8 @@
# offers some utility functions regarding those.
###
class Permissions
GROUP_WORLD = 'group:__world__'
this.$inject = ['auth']
constructor: (auth) ->
###
*
...
...
@@ -33,7 +36,7 @@ class Permissions
###
@public = ->
return {
read: [
'group:__world__'
]
read: [
GROUP_WORLD
]
update: [auth.user]
delete: [auth.user]
admin: [auth.user]
...
...
@@ -49,7 +52,7 @@ class Permissions
# visible(readable) or not.
###
isPublic: (annotation) ->
'group:__world__'
in (annotation.permissions?.read or [])
GROUP_WORLD
in (annotation.permissions?.read or [])
###
*
# @ngdoc method
...
...
@@ -72,7 +75,7 @@ class Permissions
for
token
in
tokens
if
user
==
token
return
true
if
token
==
'group:__world__'
if
token
==
GROUP_WORLD
return
true
# No tokens matched: action should not be performed.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment