1 | can :crud, Paper |
1 2 | # 用户只能对 owner 是他们自己的 Paper 资源进行 read 操作 can :read, Paper, owner: user.email |
1 | # 用户只能对 content 长度小于500且内容不为空的 Paper 的资源进行 eidt 和 update 操作 |
1 | class PapersController < ActionController::Base |
1 | class LogController < ApplicationControlle |
1 2 3 4 | user ||= User.new if user.has_role? :admin authorize! :info, :logs end |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |