Various code cleaning, mainly on User, Permission and IssueStatus models.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@414 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2007-04-04 17:26:05 +00:00
parent a9a082f05c
commit e227b92972
8 changed files with 23 additions and 33 deletions
+2 -2
View File
@@ -86,8 +86,8 @@ class ApplicationController < ActionController::Base
# admin is always authorized
return true if self.logged_in_user.admin?
# if not admin, check membership permission
@user_membership ||= Member.find(:first, :conditions => ["user_id=? and project_id=?", self.logged_in_user.id, @project.id])
if @user_membership and Permission.allowed_to_role( "%s/%s" % [ ctrl, action ], @user_membership.role_id )
@user_membership ||= logged_in_user.role_for_project(@project)
if @user_membership and Permission.allowed_to_role( "%s/%s" % [ ctrl, action ], @user_membership )
return true
end
render :nothing => true, :status => 403