roles

How can I access the meta class of the module my Moose role is being applied to?

ⅰ亾dé卋堺 提交于 2019-11-30 13:36:58
问题 I'm using Moose roles to apply some wrapper behaviour around some accessor methods in a class. I want to apply this role to a number of modules, each of which have a different set of attributes whose accessors I want to wrap. Is there a way to access the meta class of the module being applied to, from within the role? i.e. something like this: package My::Foo; use Moose; with 'My::Role::X'; has [ qw(attr1 attr2) ] => ( is => 'rw', # ... ); has 'fields' => ( is => 'bare', isa => 'ArrayRef[Str]

building Role based application

守給你的承諾、 提交于 2019-11-30 10:01:02
I have to make a small website where I have 7 type of users. which can login into system. some of users have permissions to only add equipments and others can add/edit. some of them can only view. There will be some common fields for all users adding equipments in system and some fields will be user specific. I have to track all changes in equipments with user changing equipments. Can any one explain what will be best way to do this job. Way in the sense table structure for users and tracking changes in equipments and users tracking for both login and what changes done by them. Am using php

What are some good role authorization solutions used with Authlogic?

不想你离开。 提交于 2019-11-30 09:50:56
I am looking for a good role based authorization solution to use alongside Authlogic. Anyone have any good suggestions? Please list some pros and cons from your experience if possible please. Acl9 works great with AuthLogic: http://github.com/be9/acl9/tree/master At RailsConf, I saw a lightning talk on Lockdown and was very impressed. Anyone with a modest amount of db and rails experience can roll their own ACL system, but Lockdown looks nice because it tries to keep the permission stuff out of the way. http://lockdown.rubyforge.org/ I had used role_requirement previously but I didn't dig it.

Set Property Value on Master Page from Content Page

那年仲夏 提交于 2019-11-30 09:44:49
I need to pass data to a variable in my master page each time a page is loaded. I have a string[] of RequiredRoles that I set on each content page defining what roles are required to access that page. On my master page, I have a method that takes this array, and checks to see if the current user is in one or more of those roles. How would I go about managing this? I basically want each page to have a String[] RequiredRoles defined, and the master page will load this on each call and check to see if the users are in those roles. Michael Kniskern Create a property in your master page and you

SQL Server - Give a Login Permission for Read Access to All Existing and Future Databases

妖精的绣舞 提交于 2019-11-30 09:00:30
问题 I have a stored procedure that finds all the existing databases and reads from a table in each one. Is there a way I can give a login read access to all databases, and to all future databases i.e., I won't have to do anything when a new database is added? Is there a server role that would work? Is there a way to make a SQL agent job add the permissions on any new databases? Or is there some other method? 回答1: For new databases, add the user in the model database. This is used as the template

How can I access the meta class of the module my Moose role is being applied to?

五迷三道 提交于 2019-11-30 07:37:06
I'm using Moose roles to apply some wrapper behaviour around some accessor methods in a class. I want to apply this role to a number of modules, each of which have a different set of attributes whose accessors I want to wrap. Is there a way to access the meta class of the module being applied to, from within the role? i.e. something like this: package My::Foo; use Moose; with 'My::Role::X'; has [ qw(attr1 attr2) ] => ( is => 'rw', # ... ); has 'fields' => ( is => 'bare', isa => 'ArrayRef[Str]', default => sub { [qw(attr1 attr2) ] }, ); 1; package My::Role::X; use Moose::Role; # this should be

Role name in association relationship

南楼画角 提交于 2019-11-30 07:25:51
From the UML bible, about role : Role: A role name explains how an object participates in the relationship. Each object needs to hold a reference to the associated object or objects. The reference is held in an attribute value within the object. When there is only one association then there is only one attribute holding a reference. What does this sentence mean? Can anyone please offer an example to explain it? Roles:A role name explains how an object participates in the relationship. You have two classes, Professor and Book and they are associated as in the following diagram: The role gives a

What is the best mechanism to implement granular security (i.e. authorization) in an ASP.NET MVC application?

夙愿已清 提交于 2019-11-30 07:13:15
问题 Suppose a high-speed developer was tasked with building a banking application which would be accessed by many different people. Each person would want to access his or her own account information but would not want others to access it. I would like to know the best practice for restricting access in an MVC application so that only the user who owns the information (or an administrator) could access it. The Authorize attribute allows us to restrict by role. While this is a starting point, it

Why did PostgreSQL merge users and groups into roles?

若如初见. 提交于 2019-11-30 06:31:09
问题 From the PostgreSQL docs: The concept of roles subsumes the concepts of "users" and "groups". In PostgreSQL versions before 8.1, users and groups were distinct kinds of entities, but now there are only roles. Any role can act as a user, a group, or both. Why did they make this change in 8.1? Perhaps it's easier from the C coders point of view, with a single Role class (struct)? More details: CREATE USER is equivalent to CREATE ROLE except that CREATE USER gives the LOGIN permission to the

How do you access the roles of the currentItem from a listview in QML?

£可爱£侵袭症+ 提交于 2019-11-30 06:13:39
I'm trying to access a role from a ListView in QML. Essentially, I have this in my QML: ListView { id: myId model: myModel delegate: Item { Text { text: model.text } Text { text: model.moreText } } } myModel is a QAbstractListModel implementation. The QML portion of this is a reusable component, so the model could have any number of different roles with various data types. What I would like to do is bind to the value of a given role of the currentItem property of the ListView. In other words, I'd like to have some other Component on the page that could bind a property to the currently selected