[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.axapta.programming

How to set scurity for a user group for a table with x++

Luegisdorf

12/1/2005 11:34:00 AM

I'm interested to know how to set security settings for a table for a
specific user group. The setup form inside axapta looks very complex and
always refers to the displayed menu tree.

Are there any examples.

Thank you in advance
Best regards
Patrick
7 Answers

Mike Frank

12/1/2005 1:43:00 PM

0

I'm not sure, what exactly the problem because I think security setup in 3.0 is quite easy once you
got the hang of it ;-)

You find the table under it's security key in the user group security form for the user group in
question. (E.g. for InventTable the path is Invent\Tables\InventTable, make sure you choose security
in the display field on the top)
Then you can set access right for the whole table or for single fields, fieldGroups.

BTW: Have you been on the phone with Jim last Wednesday (or the week before), I somehow missed this one?

Mike

Luegisdorf

12/1/2005 1:58:00 PM

0

Hi Mike

The problem is that I don't get it run trough x++. Say I want the user group
'group1' provide view rights for table 'myTable' which has the securitykey
'mySecurityKey'. Now: how to get it run with a (or some) simple x++ commands
(for automatisation by click ...)?

I'm anxious to read your response ;-)

Greetz from Switzerland
Patrick

PS: About Jim; Did you mean the monthly MVP call? If I should be dead honest
I have to say that I've never joined at any MVP Net meeting ....

"Mike Frank" wrote:

> I'm not sure, what exactly the problem because I think security setup in 3.0 is quite easy once you
> got the hang of it ;-)
>
> You find the table under it's security key in the user group security form for the user group in
> question. (E.g. for InventTable the path is Invent\Tables\InventTable, make sure you choose security
> in the display field on the top)
> Then you can set access right for the whole table or for single fields, fieldGroups.
>
> BTW: Have you been on the phone with Jim last Wednesday (or the week before), I somehow missed this one?
>
> Mike
>

Mike Frank

12/2/2005 8:01:00 AM

0

I'm sorry Patrick. I did not pay attention to the subject line and so was not aware, that you are
looking for an X++ solution. I have not done that yet :-(

Grü�e Mike ( I thought it was Gruetzi for you ;-)

Mike Frank

12/2/2005 8:58:00 AM

0

You got me interested ;-) Here's how it can be done:

static void CbsSetAccessRights(Args _args)
{
SecurityKeySet securityKeySet = new SecurityKeySet();
UserGroupId userGroupId = 'Dev';
domainId domainId = 'Admin';
;
// TODO check that userGroup and domain exist
securityKeySet.loadGroupRights(userGroupId, domainId);
// TODO check, that the access does not exceed the table's MaxAccessMode
// (is done in SysSecurityUserGroup)
securityKeySet.tableAccess(tablenum(InventTable), AccessType::Add);
// this one writes directly to the AccessRightsList table
xAccessRightsList::saveSecurityRights(securityKeySet.packTouched(), userGroupId, domainId);
}

Information was extracted from the listed elements:
\System Documentation\Classes\SecurityKeySet
\Classes\SysSecurity
\Classes\SysSecurityUserGroup
\Forms\SysUserGroupSecurity

Luegisdorf

12/5/2005 9:01:00 AM

0

Hi Mike

Absolutely great! Works very fine - and it's really easy to use. Thank you
very, very much.

PS: "Grüezi" is only to use like "welcome" and 'Greetz' means just
'greetings'. To say goodby you could use "Tschau", "Salü/Salut", "Adieu" or
"Tschüss" for someone you know personally, the more formerly expressions are
"Auf Wiedersehen" or just "Mit freundlichen Grüssen" ;-)

regards
Patrick

"Mike Frank" wrote:

> You got me interested ;-) Here's how it can be done:
>
> static void CbsSetAccessRights(Args _args)
> {
> SecurityKeySet securityKeySet = new SecurityKeySet();
> UserGroupId userGroupId = 'Dev';
> domainId domainId = 'Admin';
> ;
> // TODO check that userGroup and domain exist
> securityKeySet.loadGroupRights(userGroupId, domainId);
> // TODO check, that the access does not exceed the table's MaxAccessMode
> // (is done in SysSecurityUserGroup)
> securityKeySet.tableAccess(tablenum(InventTable), AccessType::Add);
> // this one writes directly to the AccessRightsList table
> xAccessRightsList::saveSecurityRights(securityKeySet.packTouched(), userGroupId, domainId);
> }
>
> Information was extracted from the listed elements:
> \System Documentation\Classes\SecurityKeySet
> \Classes\SysSecurity
> \Classes\SysSecurityUserGroup
> \Forms\SysUserGroupSecurity
>

Mike Frank

12/5/2005 10:14:00 AM

0

> Absolutely great! Works very fine - and it's really easy to use. Thank you
> very, very much.

You are very welcome ;-)

> PS: "Grüezi" is only to use like "welcome" and 'Greetz' means just
> 'greetings'. To say goodby you could use "Tschau", "Salü/Salut", "Adieu" or
> "Tschüss" for someone you know personally, the more formerly expressions are
> "Auf Wiedersehen" or just "Mit freundlichen Grüssen" ;-)

Thanks for the explanation. The way "Tschüss" is used is probably like we used it in East Germany,
when it was still the GDR. Nowadays in Germany you say Tschüss to everyone (Except the Bundeskanzler
maybe ;-)

Mike

Mike Frank

12/5/2005 10:22:00 AM

0

> Absolutely great! Works very fine - and it's really easy to use. Thank you
> very, very much.

You are very welcome :-)

> PS: "Grüezi" is only to use like "welcome" and 'Greetz' means just
> 'greetings'. To say goodby you could use "Tschau", "Salü/Salut", "Adieu" or
> "Tschüss" for someone you know personally, the more formerly expressions are
> "Auf Wiedersehen" or just "Mit freundlichen Grüssen" ;-)

Thanks for the explanation. The way "Tschüss" is used is probably like we used it in East Germany,
when it was still the GDR. Nowadays in Germany you say Tschüss to everyone (Except the Bundeskanzler
maybe ;-)

Mike