Discussion:
How to check specific user's access rights in codes?
(too old to reply)
Jeff
2008-09-04 04:38:00 UTC
Permalink
after loginning with userid user1, how to check the another user's access
rights to a menu item or a button in the code?

scenario:
one security key SK1
two menu items named menuItem1 and menuItem2. their security key are set
as SK1
two user groups: administrators and UG1. user group administrators has
access permission to both menuItem1 and menuItem2. UG1 only has access
permission to menuItem1.
user1 is a member of administrators and user2 is a member of UG1.
Mathias
2008-09-04 05:58:02 UTC
Permalink
Hello Jeff,

to check menu item access you can use

Global::hasMenuItemAccess(menuitemdisplaystr(<yourmenuitemname>),
MenuItemType::Display);

or to check security key

Global::hasSecuritykeyAccess(securitykeynum(<yoursecuritykeyname>),
AccessType::View);

I hope this is what you are looking for.

Kind regards
--
Mathias Füßler
my blog: http://starside.eu
Post by Jeff
after loginning with userid user1, how to check the another user's access
rights to a menu item or a button in the code?
one security key SK1
two menu items named menuItem1 and menuItem2. their security key are set
as SK1
two user groups: administrators and UG1. user group administrators has
access permission to both menuItem1 and menuItem2. UG1 only has access
permission to menuItem1.
user1 is a member of administrators and user2 is a member of UG1.
Mathias
2008-09-04 06:01:00 UTC
Permalink
i misread your question.
my post is not an answer to your question.
sorry about that.
--
Mathias Füßler
my blog: http://starside.eu
Post by Mathias
Hello Jeff,
to check menu item access you can use
Global::hasMenuItemAccess(menuitemdisplaystr(<yourmenuitemname>),
MenuItemType::Display);
or to check security key
Global::hasSecuritykeyAccess(securitykeynum(<yoursecuritykeyname>),
AccessType::View);
I hope this is what you are looking for.
Kind regards
--
Mathias Füßler
my blog: http://starside.eu
Post by Jeff
after loginning with userid user1, how to check the another user's access
rights to a menu item or a button in the code?
one security key SK1
two menu items named menuItem1 and menuItem2. their security key are set
as SK1
two user groups: administrators and UG1. user group administrators has
access permission to both menuItem1 and menuItem2. UG1 only has access
permission to menuItem1.
user1 is a member of administrators and user2 is a member of UG1.
Jeff
2008-09-04 06:33:00 UTC
Permalink
Thanks all the same
Post by Mathias
i misread your question.
my post is not an answer to your question.
sorry about that.
--
Mathias Füßler
my blog: http://starside.eu
Post by Mathias
Hello Jeff,
to check menu item access you can use
Global::hasMenuItemAccess(menuitemdisplaystr(<yourmenuitemname>),
MenuItemType::Display);
or to check security key
Global::hasSecuritykeyAccess(securitykeynum(<yoursecuritykeyname>),
AccessType::View);
I hope this is what you are looking for.
Kind regards
--
Mathias Füßler
my blog: http://starside.eu
Post by Jeff
after loginning with userid user1, how to check the another user's access
rights to a menu item or a button in the code?
one security key SK1
two menu items named menuItem1 and menuItem2. their security key are set
as SK1
two user groups: administrators and UG1. user group administrators has
access permission to both menuItem1 and menuItem2. UG1 only has access
permission to menuItem1.
user1 is a member of administrators and user2 is a member of UG1.
Jeff
2008-09-05 06:22:00 UTC
Permalink
what do methods end with Touched in class SecurityKeySet for?
Post by Jeff
Thanks all the same
Post by Mathias
i misread your question.
my post is not an answer to your question.
sorry about that.
--
Mathias Füßler
my blog: http://starside.eu
Post by Mathias
Hello Jeff,
to check menu item access you can use
Global::hasMenuItemAccess(menuitemdisplaystr(<yourmenuitemname>),
MenuItemType::Display);
or to check security key
Global::hasSecuritykeyAccess(securitykeynum(<yoursecuritykeyname>),
AccessType::View);
I hope this is what you are looking for.
Kind regards
--
Mathias Füßler
my blog: http://starside.eu
Post by Jeff
after loginning with userid user1, how to check the another user's access
rights to a menu item or a button in the code?
one security key SK1
two menu items named menuItem1 and menuItem2. their security key are set
as SK1
two user groups: administrators and UG1. user group administrators has
access permission to both menuItem1 and menuItem2. UG1 only has access
permission to menuItem1.
user1 is a member of administrators and user2 is a member of UG1.
Petr Sehnal
2011-04-10 09:43:26 UTC
Permalink
I needed the same. Easy but took a while ...

SecurityKeySet securityKeySet = new SecurityKeySet();
AccessType accessType;
;

securityKeySet.loadUserRights(curuserid()); // accessType = AccessType::Delete
securityKeySet.loadUserRights("NonExistingUser"); // accessType = AccessType::NoAccess

accessType = securityKeySet.menuItemAccess(menuitemdisplaystr("CustTable"),AccessRecordType::MenuItemDisplay);

info(strFmt("%1",accessType));
Post by Jeff
after loginning with userid user1, how to check the another user's access
rights to a menu item or a button in the code?
one security key SK1
two menu items named menuItem1 and menuItem2. their security key are set
as SK1
two user groups: administrators and UG1. user group administrators has
access permission to both menuItem1 and menuItem2. UG1 only has access
permission to menuItem1.
user1 is a member of administrators and user2 is a member of UG1.
Post by Mathias
Hello Jeff,
to check menu item access you can use
Global::hasMenuItemAccess(menuitemdisplaystr(<yourmenuitemname>),
MenuItemType::Display);
or to check security key
Global::hasSecuritykeyAccess(securitykeynum(<yoursecuritykeyname>),
AccessType::View);
I hope this is what you are looking for.
Kind regards
--
Mathias FÌßler
my blog: http://starside.eu
Post by Mathias
i misread your question.
my post is not an answer to your question.
sorry about that.
--
Mathias FÌßler
my blog: http://starside.eu
Post by Jeff
Thanks all the same
Post by Jeff
what do methods end with Touched in class SecurityKeySet for?
Loading...