Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
820c08ce
Commit
820c08ce
authored
Apr 12, 2016
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix documentation and improve permissions code
parent
7d54e721
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
6 additions
and
13 deletions
+6
-13
app/models/ability.rb
app/models/ability.rb
+1
-0
app/views/admin/application_settings/_form.html.haml
app/views/admin/application_settings/_form.html.haml
+1
-1
doc/permissions/permissions.md
doc/permissions/permissions.md
+0
-7
doc/public_access/public_access.md
doc/public_access/public_access.md
+3
-0
lib/api/api_guard.rb
lib/api/api_guard.rb
+0
-4
lib/api/users.rb
lib/api/users.rb
+1
-1
No files found.
app/models/ability.rb
View file @
820c08ce
...
...
@@ -120,6 +120,7 @@ class Ability
def
global_abilities
(
user
)
rules
=
[]
rules
<<
:create_group
if
user
.
can_create_group
rules
<<
:read_users_list
rules
end
...
...
app/views/admin/application_settings/_form.html.haml
View file @
820c08ce
...
...
@@ -28,7 +28,7 @@
=
level
%span
.help-block
#restricted-visibility-help
Selected levels cannot be used by non-admin users for projects or snippets.
If
public level is restricted user profiles are not accessible to not logged
users.
If
the public level is restricted, user profiles are only visible to logged in
users.
.form-group
=
f
.
label
:import_sources
,
class:
'control-label col-sm-2'
.col-sm-10
...
...
doc/permissions/permissions.md
View file @
820c08ce
...
...
@@ -93,10 +93,3 @@ An administrator can flag a user as external [through the API](../api/users.md)
or by checking the checkbox on the admin panel. As an administrator, navigate
to
**Admin > Users**
to create a new user or edit an existing one. There, you
will find the option to flag the user as external.
## Restricted visibility levels
Visibility levels can be restricted in admin settings page by administrator, when
restricting a visibility level groups, projects and snippets are not allowed to be
created with that visibility setting. If the public visibility level is restricted
user profiles are accessible to not logged users.
doc/public_access/public_access.md
View file @
820c08ce
...
...
@@ -58,6 +58,9 @@ you are logged in or not.
When visiting the public page of a user, you can only see the projects which
you are privileged to.
If the public level is restricted, user profiles are only visible to logged in users.
## Restricting the use of public or internal projects
In the Admin area under
**Settings**
(
`/admin/application_settings`
), you can
...
...
lib/api/api_guard.rb
View file @
820c08ce
...
...
@@ -79,10 +79,6 @@ module APIGuard
@current_user
end
def
public_access_restricted?
current_application_settings
.
restricted_visibility_levels
.
include?
(
Gitlab
::
VisibilityLevel
::
PUBLIC
)
end
private
def
find_access_token
@access_token
||=
Doorkeeper
.
authenticate
(
doorkeeper_request
,
Doorkeeper
.
configuration
.
access_token_methods
)
...
...
lib/api/users.rb
View file @
820c08ce
...
...
@@ -11,7 +11,7 @@ module API
# GET /users?search=Admin
# GET /users?username=root
get
do
if
!
current_user
&&
public_access_restricted?
unless
can?
(
current_user
,
:read_users_list
,
nil
)
render_api_error!
(
"Not authorized."
,
403
)
end
...
...
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