i realise that im using Cuyahoga for purposes for which it was not originally intended, but i actually think that's a great tribute to the way its designed.
My idea was that since most of the core is nicely designed around interfaces, we could probably do the same with permissions, while supplying a default implementation for the general case.
my use case involves user groups, where there is not necessarily a flat role namespace or simple section -> permission mapping. Think social networks with groups, friends and networks. i ran across this
Rhino Security and it fits my needs perfectly, so i want to integrate this in a nice way.
i can get by without this, since permissions will be hidden behind a facade, but designwise i think it would be cleaner (for me at least).
jbland
Not really as powerful as Rhino-Security, but in the 2.0 trunk things have already changed. Besides users and roles, we now also have rights. The plain role-based security just doesn't cut it anymore.
In 2.0, roles can be seen as groups that have a set of rights. Administrators can add or remove roles, but the rights are fixed.
Currently, access to administration functionality is all or nothing. With the new system, this can be customized to everyone's liking. Also, for module developers, it's going to be possible to perform security checks on individual module actions.
At this moment, authorization checks are performed in the Domain (User.HasRight(right)), but it might indeed be a good thing to create an IAuthorizationService interface because it allows developers to add custom authorization logic.
I kinda agree with jbland. Like I have a situation where an editor wants to add and remove menu buttons. This isn't possible because of the fact that only administrators can do that.
But an improved security is good already...
The idea of an interface is very useful to my use case, which is using LDAP server to model user, roles & rights(possibly).
The reasonning for using LDAP is because it fits into large installation where LDAP is the security server period.
ged
JboogI kinda agree with jbland. Like I have a situation where an editor wants to add and remove menu buttons. This isn't possible because of the fact that only administrators can do that.
Exactly one of the reasons why the Rights-based system is introduced. To enable a more granular usage of the administration site without requiring everyone to be an administrator.
gedw99The idea of an interface is very useful to my use case, which is using LDAP server to model user, roles & rights(possibly).
A lilttle bit offtopic, but do you already have an idea how to link users and roles from an LDAP server to Cuyahoga objects like nodes, sections and content?
Been done before.. Azman.
There is the MS crap one, and there is the open source one.
we use the open source Azman allot, and it can be integrated with almost any application reasonably easy.
http://netsqlazman.sourceforge.net
in LDAP you have local and global roles. The very existence of Local roles in LDAP is based on allowing it to integrate with many applications that need to inherit from roles and users in LDAP.
Another good resurce is the work on XMPP and Erlang, mappng to LDAp stores. This again provide application integration with the Erlang router acting as a security system on top of LDAP. Applications cal into the Elrang system for XMPP based authentication, but its all backed on LDAP.
Also, the idea of Surrogate Keys is essential, with Synchronisation allow stale or deleted roles and users to be pulled and pushed out of the system over time.
These are 3 approaches that are the same but different in various ways. But googleing arodn this shoudl give you good best practice ideas.
interestingly enough the principle of how to integrate other dependencies at the data model level is something that many applications have to solve. If Cuya can solve this it makes it easy to leverage other open and closed source solutions, and leaving Cuya to be the Switchboard. Its a very powerful ability to have that few softare applicatin are designed to do.
You have to design this way to do reusable software i believe.
i fuly expect to be slain for writing this though as it is not a yes no answer.
Thanks.
I guess, the way to go is add extra surrogate keys to user and role and build a synchronization layer on top of it for full integration.
Martin,
Hey. Yes i think so currently. To answer you question, yes SK is the way to go.
But i just want to add more to this space.
If i may, i just looked at the trunk and the design of the Rights, etc.
If i see it correctly it is:
1. You give an operation a name in code using a declarative attribute at design time. This is just a name defined by a namespace then.
2. at Runtime, you associate (for example if using LDAP) a Local LDAP role with the operation name (AKA Right). This is then fully data driven.
Azman is exactly this model. Its awesome because it allows the security to be data driven off ANY store. LDAP or database of any http addressable thing (e.g . XMPP).
The design as i see it looks very powerful that is there if what i described above is what it is.
But Azman goes even further and would be very easily slotted into Cuya as a library. HINT HINT.. Just wrap it in Cuya. it is open sourced. Not sure about license, but if i rememebr correctly its quite open.
I used it a few times, and the architecure is sound and designed for extensibility.
There are many very good patterns and lessons in the code & design itsfl that answer many questiosn you have or will have too. SO if you elect to not wrap it, you could use the ideas in it instead.
The other thing that comes to mind that i see alot is dealing with Data Level Authourisation. For example, i need to say show me all these record in the data store (say a db) that has the Created field of "Fred" or the Role of "Manager" or the Right of "Can do X". This is a very important thing to be able to do as you well know for 99% of applications.
So the user & role is modelled in the DB, but in reality the Master of the User & role is some LDAP system.
In the LDAP system i may make "FRED" inactive OR i may delete "FRED". So how is the security system in Cuya going to express this.
Its must model these generic aspects of an LDAP schema with a generic property driven schema to allow me to Model Fred as being Inactive or Deleted !! . LDAP schema themselves are sometimes customised too and AD and OPENLDAP have very different implementatiosn of their data model for these edge cases. Hecne the need to have a property driven schema to model this stuff.
THe other thign is this. How does Cuya keep all its Surrogate Keys correctly mapped to the LDAP system?. One way is that when Fred logs in, the Local Roles of Fred are pulled across and Updated in the User to Roles mapping in the DB of Cuya. This is vital so that when i do data level queries and query by Role (For example show me all Cars whose creator has a Role of X), it works correctly. In other words it is not enough to query LDAP on Authentication and store the rights in the IPrinciple & IIdentity objects. It has to be transacted to the DB, so that data level quereis can also use the security system and express queries against the security meta data.
Hope i am making sense as i have written a fair bit. And i have probably repeated myself a bit here.
g
gedw99If i may, i just looked at the trunk and the design of the Rights, etc.
If i see it correctly it is:
1. You give an operation a name in code using a declarative attribute at design time. This is just a name defined by a namespace then.
2. at Runtime, you associate (for example if using LDAP) a Local LDAP role with the operation name (AKA Right). This is then fully data driven.
Exactly.
Hope i am making sense as i have written a fair bit. And i have probably repeated myself a bit here.
It's an interesting read and you mentioned the same possible issues that I was thinking of. Thanks.