Hi,
I want to know how I can manage to make only these parts visible for users, which are associated with the users role.
For example, the report stores content for the whole company, but the user has only the right to see content which concerns himselfe.
Thanks for your help!
Markus
0
Comments
Then before showing certain data, you can check if the user belongs to a certain security-role.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
and how do I check the users role? Maybe somebody can show the necessary part of the code :roll:
Primary Key - User, Role ID, Company
Implements the many to many relationship between Users and User Roles.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
thanks for the code. I've tested it, but there is a problem with the variable type in these lines:
recMemberOf.SETRANGE("User ID",codUserID);
recMemberOf.SETRANGE("Role ID",codRoleID);
The variables CodRoleID and CodUserID are Boolean variables and the variable User ID and Role ID are Code variables. When I worte the follwing code infront of it:
recMemberOf.SETRANGE("User ID",FORMAT(codUserID));
recMemberOf.SETRANGE("Role ID",FORMAT(codRoleID));
..then I got problems with the line: EXIT(TRUE), because, at this time the format changed from boolean to code.
These variables are definitely code variavales.
br
Josef Metz
Josef Metz
The function "IsMemberOf" must return a BOOLEAN
But "codUserID","codRoleID" are code-fields (code20 or longer) and
txtCompanyname is a text-field (text30 or longer)
1 Remark:
I didn't test it with Windows-users, so it is possible you need "codUserID" as a text for it.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!