First version for App and Object auth.Taking Announcement as experiment

This commit is contained in:
Matthew Kaito Juyuan Fu committed 2012-02-15 18:20:44 +08:00
1 parent 17caa7cb1b
commit 5640e07733
31 files changed
+161 -52

No files matched your search

@@ -1,8 +1,12 @@
class Admin::ObjectAuthsController < ApplicationController
include OrbitCoreLib::PermissionUnility
layout "admin"
before_filter :authenticate_user!
before_filter :check_if_user_can_do_object_auth
# before_filter :is_admin? ,:only => :index
def index
# if current_user.admin?
@object_auths = ObjectAuth.all
@@ -70,7 +74,11 @@ class Admin::ObjectAuthsController < ApplicationController
def edit
@object_auth = ObjectAuth.find(params[:id])
end
private
def check_if_user_can_do_object_auth
unless check_permission(:manager)
render :nothing => true, :status => 403
end
end
end