PROCEDURE IsSuperUser() : Boolean VAR User : Record 2000000120; AccessControl : Record 2000000053; BEGIN IF User.ISEMPTY THEN EXIT(TRUE); User.SETRANGE("User Name",USERID); IF NOT User.FINDFIRST THEN EXIT(FALSE); AccessControl.SETRANGE("User Security ID",User."User Security ID"); AccessControl.SETRANGE("Role ID",'SUPER'); AccessControl.SETFILTER("Company Name",'%1|%2',COMPANYNAME,''); EXIT(NOT AccessControl.ISEMPTY); END;
Answers
Ok, and? How do you do it?
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
On a page, set up a variable that you can use on the Enabled property of the control. OnOpenPage calculate the value of the Variable.
OnValidate of the field in the Table you can do a check and issue an error. The scope of this check is more global, but the user gets an error only after he entered a value on the page.
To determine the rights, the easiest thing to do is choose a table, to which only SUPER has access and use READPERMISSION/WRITEPERMISSION.
If you must check for the SUPER role, the whole thing gets version specific and depends on the type of login. Anyway, your starting point is USERID and your end point ist the system table containing the Roles/Access Control. (or better, actually, the table Permission)
Yes, that was the plan but how do you check if a user is super in c/al code?
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav