This repository has been archived by the owner on Feb 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
finished default_users that are included in projects
- Loading branch information
Gregory Eric Sanderson
committed
Jan 27, 2010
1 parent
9e88ca1
commit 29dd21b
Showing
16 changed files
with
272 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
class DefaultUserPermission < ActiveRecord::Base | ||
belongs_to :company | ||
belongs_to :default_user, :class_name => "User", :foreign_key => "user_id" | ||
belongs_to :user | ||
|
||
def can? (perm) | ||
case perm | ||
when 'comment' then self.can_comment? | ||
when 'work' then self.can_work? | ||
when 'close' then self.can_close? | ||
when 'report' then self.can_report? | ||
when 'create' then self.can_create? | ||
when 'edit' then self.can_edit? | ||
when 'reassign' then self.can_reassign? | ||
when 'prioritize' then self.can_prioritize? | ||
when 'milestone' then self.can_milestone? | ||
when 'grant' then self.can_grant? | ||
when 'all' then (self.can_comment? && self.can_work? && self.can_close? && self.can_report? && self.can_create? && self.can_edit? && | ||
self.can_reassign? && self.can_prioritize? && self.can_milestone? && self.can_grant?) | ||
end | ||
end | ||
|
||
def set(perm) | ||
case perm | ||
when 'comment' then self.can_comment = 1 | ||
when 'work' then self.can_work = 1 | ||
when 'close' then self.can_close = 1 | ||
when 'report' then self.can_report = 1 | ||
when 'create' then self.can_create = 1 | ||
when 'edit' then self.can_edit = 1 | ||
when 'reassign' then self.can_reassign = 1 | ||
when 'prioritize' then self.can_prioritize = 1 | ||
when 'milestone' then self.can_milestone = 1 | ||
when 'grant' then self.can_grant = 1 | ||
when 'all' then | ||
self.can_comment = 1 | ||
self.can_work = 1 | ||
self.can_close = 1 | ||
self.can_report = 1 | ||
self.can_create = 1 | ||
self.can_edit = 1 | ||
self.can_reassign = 1 | ||
self.can_prioritize = 1 | ||
self.can_milestone = 1 | ||
self.can_grant = 1 | ||
end | ||
end | ||
|
||
def remove(perm) | ||
case perm | ||
when 'comment' then self.can_comment = 0 | ||
when 'work' then self.can_work = 0 | ||
when 'close' then self.can_close = 0 | ||
when 'report' then self.can_report = 0 | ||
when 'create' then self.can_create = 0 | ||
when 'edit' then self.can_edit = 0 | ||
when 'reassign' then self.can_reassign = 0 | ||
when 'prioritize' then self.can_prioritize = 0 | ||
when 'milestone' then self.can_milestone = 0 | ||
when 'grant' then self.can_grant = 0 | ||
when 'all' then | ||
self.can_comment = 0 | ||
self.can_work = 0 | ||
self.can_close = 0 | ||
self.can_report = 0 | ||
self.can_create = 0 | ||
self.can_edit = 0 | ||
self.can_reassign = 0 | ||
self.can_prioritize = 0 | ||
self.can_milestone = 0 | ||
self.can_grant = 0 | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<table class="content" id="user_table" width="100%" style="margin-left:0;margin-right:0;"> | ||
<tr> | ||
<th><%=_ 'User' %></th> | ||
<th><%=_ "Remove" %></th> | ||
<th><%=_ 'Comment' %></th> | ||
<th><%=_ 'Work' %></th> | ||
<th><%=_ 'Close' %></th> | ||
<th><%=_ 'Create' %></th> | ||
<th><%=_ 'Edit' %></th> | ||
<th><%=_ 'Assign' %></th> | ||
<th><%=_ 'Prioritize' %></th> | ||
<th><%=_ 'Milestones' %></th> | ||
<th><%=_ 'Reports' %></th> | ||
<th><%=_ 'Grant' %></th> | ||
<th><%=_ 'All' %></th> | ||
</tr> | ||
|
||
<% @company.default_users.each do |user| %> | ||
<%= render(:partial => "/users/user_permissions", :locals => { | ||
:user => user, :base => @company, :user_edit => false, :users => @company.default_users, :creator => nil, :perm => user.default_user_permission }) %> | ||
<% end %> | ||
|
||
<tr id="add_user"> | ||
<td> | ||
<%= _("Add user") %> | ||
</td> | ||
<td colspan="11"> | ||
<%= text_field_with_auto_complete(:user, :name, { :value => "" }, | ||
:after_update_element => "addUserToCompany", | ||
:select => "complete_value", | ||
:url => "/companies/auto_complete_for_user_name") %> | ||
</td> | ||
</tr> | ||
</table> | ||
|
||
<script type="text/javascript" language="javascript" charset="utf-8"> | ||
updateTooltips(); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,5 +13,3 @@ | |
</label> | ||
<%= incoming_email_select_tag %> | ||
<br /> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.