Hi,
If someone logs on to my application this user contains a dictionary with certain permissions.
ex: module.view.workspace = true
module.view.reporting = false
...
Then we know to what parts of the application the user has access. What I want to know is how we can apply these permissions on the view. We are working in an AS 3 (FLEX) environment.
This is what we came up with so far (but I wanna have an idea of other possibilities). We have a modelLocator storing the loggedOnUser (which contains it's permissions). these permissions are added to a permissionObject in the modellocator. We Create a SecurityManager class that has a function called hasAccess("permission"). This object will check the PermissionObject in the modellocator and return true/false. In the view we just check if the user has access and then show the control.
If (SecurityManager.hasAccess("module.view.workspace") {
// code that generates the workspace;
}
I just don't know if this is the best practice. Please help me out here.
Regards, Sem