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
c66c30c8
Commit
c66c30c8
authored
Oct 20, 2011
by
gitlabhq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add check to ensure that a team member has atleast one Access Role selected
parent
c7ccfb9a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
app/models/users_project.rb
app/models/users_project.rb
+6
-1
No files found.
app/models/users_project.rb
View file @
c66c30c8
...
...
@@ -9,7 +9,8 @@ class UsersProject < ActiveRecord::Base
validates_uniqueness_of
:user_id
,
:scope
=>
[
:project_id
]
validates_presence_of
:user_id
validates_presence_of
:project_id
validate
:user_has_a_role_selected
delegate
:name
,
:email
,
:to
=>
:user
,
:prefix
=>
true
def
update_gitosis_project
...
...
@@ -18,6 +19,10 @@ class UsersProject < ActiveRecord::Base
end
end
def
user_has_a_role_selected
errors
.
add
(
:base
,
"Please choose at least one Role in the Access list"
)
unless
read
||
write
||
admin
end
end
# == Schema Information
#
...
...
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