Sha256: 06e48de41113a0bd93164e1ef24a09f33b44a4cdae7268193ea3753c3b7e060b
Contents?: true
Size: 513 Bytes
Versions: 18
Compression:
Stored size: 513 Bytes
Contents
### context_roles.rb # # Defines the context roles for the CBAC system # include Cbac # Defining context roles ContextRole.add :not_logged_in_user, 'current_user == 0' ContextRole.add :logged_in_user, 'current_user.to_i > 0' ContextRole.add :everybody, "true" ContextRole.add :news_owner do context[:post].user.id == current_user end ContextRole.add :news_owner_with_email do return false if News.find(params[:id]).author_id == current_user return false if User.find(current_user).email.nil? true end
Version data entries
18 entries across 9 versions & 1 rubygems