declarative-authorization

declarative_authorization and namespaces

人盡茶涼 提交于 2019-12-23 07:57:17
问题 Do you know - can declarative_authorization control access to namespace'd resources or not? I've tried something like has_permission_on [:admin, :users], :to => [:index, :show, :new, :create, :edit, :update, :destroy, :search] but it's not working :( any ideas on this? 回答1: This will work: has_permission_on :admin_users, :to => [:index, :show, :new, :create, :edit, :update, :destroy, :search] declarative_authorization prefixes the resource name with the namespace as [:admin, :users] could

Java EE declarative security, acquiring reference to a secured bean from application client

我是研究僧i 提交于 2019-12-13 15:19:01
问题 On 2 questions I would like to consult you. Background : I have written a test, Java EE application and added declarative security. The application is deployed on Glassfish 3.1. For unit testing I used JUnit with the embedded container for all beans with local interface. For the entry point of the appliaction, the SessionFacde bean, which has the only remote interface, I wrote a simple client which acquires reference to the SessionFace bean. Security annotations I applied for the

Is it better to have roles as a column on my users table, or do it through join tables (Roles & Assignments)? - Rails 3

不羁岁月 提交于 2019-12-11 00:47:34
问题 You can see my models here: https://gist.github.com/768947 Just to explain what is happening, I have a few models. At the core of my app, there are: projects, stages, uploads, comments, users. Then there are roles & assignments to manage user authorization. I am doing this with the plugin declarative_authorization & devise for login. So the first question is, is it better to just add a column of 'Roles' to my user model/table and store the roles for each user there? If I have a user that has

if_attribute syntax problem on declarative_authorization

泪湿孤枕 提交于 2019-12-08 12:18:26
问题 I have an Organization that has_many Affiliations And a mission that has_one Organization So i can do this: m = Mission.first m.organization.affiliations A user also has_many affiliations so I can do: u = User.first u.affiliations In declarative_authorization I want a user to be able to manage a mission if he is affiliated to the organization of the mission. I'm trying this: has_permission_on :missions, :to => [:manage] do if_attribute [:affiliations, {:mission => :organization} ] =>

How to pass through parameters during Devise login

我的未来我决定 提交于 2019-12-05 18:51:26
How do I pass parameters during the Devise sign-in process? I have a collection of users, each with their own profile page. I want them to be able to view their own profile page but none of the other users' profile pages, unless they're an admin in which case they have access to everything in the application. I created a Users controller, and applied the following code to the beginning of the controller. I replaced looking up by ID with their username, so /users/username to access a profile: filter_access_to :all do current_user == User.find_by_username(params[:id]) or has_role? :admin end And