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


Author
Message
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K 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


Replies
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
You got it...this is the same approach that we take and we have good roles and data setup so that our customers can implement their desired security permissions easily.  But it is definitely best NOT to grant by default. Smile
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Any time Bill. It takes a while to really understand RBS, as it is pretty complex/full featured. It rocks though! BigGrin
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




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

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search