Is there a comparable method like SecurityBasics.CurrentUser.IsInRole("NameOfRole")?


Author
Message
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1K reputation)StrataFrame VIP (1K reputation)StrataFrame VIP (1K reputation)StrataFrame VIP (1K reputation)StrataFrame VIP (1K reputation)StrataFrame VIP (1K reputation)StrataFrame VIP (1K reputation)StrataFrame VIP (1K reputation)StrataFrame VIP (1K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
All I want to do is simply make something invisible...a navigation group on a DevExpress Navigation Bar Control.  Here is my attempt after setting up roles and permissions, then DDT to deploy:

if (SecurityBasics.CurrentUser.GetPermission("SystemMaintenance").Action == PermissionAction.Grant)
{
    AdminNavBarGroup.Visible =
true;
}
else
{
    AdminNavBarGroup.Visible =
false;
}

I have a role called "Administration".  A permission key was created for a category called Administration (not technically related).  The key is use above and it is called "SystemMaintenance".  The key is given grant rights for the "Administration" role.  I removed myself from that role to test.  The only thing that may be gumming up the works is the fact that my profile is marked as an administrator.  Does the administrator bypass any and all permission sets?

What would be nice is SecurityBasics.CurrentUser.IsInRole("Administration").  It would simply return a boolean value.  It look like I have to create a dictionary list then walk the list to see if the user is in the role or not.  Is that right?

Thanks for your help,
Bill


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Bill Cunnien - 16 Years Ago
Greg McGuffey - 16 Years Ago
Bill Cunnien - 16 Years Ago
Bill Cunnien - 16 Years Ago
Greg McGuffey - 16 Years Ago
                         Thanks a bunch, Greg! I'll work through these debugging tips tomorrow...
Bill Cunnien - 16 Years Ago
                             Good answers, Greg. :)
Trent L. Taylor - 16 Years Ago
                         [quote][b]Greg McGuffey (02/04/2008)[/b][hr]...make sure that the...
Bill Cunnien - 16 Years Ago
                             Set it on the SecurityBasics shared property: [codesnippet]...
Trent L. Taylor - 16 Years Ago
                                 Yup. That seems to work. I am getting ready to test the change, now....
Bill Cunnien - 16 Years Ago
                                     Well, if I do this: SecurityBasics .DefaultPermissionInfo = new...
Bill Cunnien - 16 Years Ago
                                         You got it...this is the same approach that we take and we have good...
Trent L. Taylor - 16 Years Ago
                                             Any time Bill. It takes a while to really understand RBS, as it is...
Greg McGuffey - 16 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search