Status | ID | Priority | Type |
Closed | 24245 | Trivial | Question |
Profile | Reply |
doorscomputersClient | Hi, |
User | Description | Posted On |
Sasha (Xafari Support)Client | Hello, At first we recommend reading these tickets: If you need any further assistance on this subject, please feel free to write this ticket. Thanks, Sasha. | |
doorscomputers | Hi, Hope you can provide a working example on this. Where employee ABC logged in then he cannot see the record of Employee JKL. Thanks! | |
doorscomputers | By the way , In my xaf application, I have inherited the Xaf Security systemuser with my employee class private string _PhoneNumber; At run time I have created new users Like "John", Luis and Ray, and made some relationship to the employee to other classes like Savings and deposit at design time , If I run the application , I want that if John Logged in, he will not see any record associated with Luis and Ray, John can only see and edit his own personal Employee record and can only read his own deposit and withdrawal transaction but he cannot edit it. Is this possible in Xaf Security ? Thanks much! | |
Sasha (Xafari Support)Client | Hello, Thank you for the additional information. Regards, Sasha. | |
Sasha (Xafari Support)Client | Hello,
You can see the video to solve your issue with the Login User,
I hope you find this information helpful. Attached files: | |
doorscomputers | Hi, thanks so much for the very detailed explanation. Does it matter if I use this in my code below? My Code Below I have used the built in xaf Security system user. I tried but it does not work, Will I strictly follow then the code you have given to me? And How do I begin the exaample you have shown on the video, I guess I will use the xafari security system right ma'am? Please be patient on me, Thanks! | |
Sasha (Xafari Support)Client | Hello,
To solve your issue you can read the DevExpress tutorials: How to: Implement a Custom Security System User Based on an Existing Business Class, How to: Implement Custom Security Objects (Users, Roles, Operation Permissions). Also you can see video and simple sample for your issue "Display Records Based on Login User" and use the settings for Xafari Security or DevExpress Security.
Let me know if you need further assistance. Attached files: | |
doorscomputers | Thanks so much for the demo. I assume that for every user created by admin, and admin will create a related record of another class for example like payroll then when that user or employee log in then he/she cannot see other records of other employees. The employee at the same time user can only see his own records whether it is the personal information or the payroll class which I intend to add then the employee cannot update it. BTW, once last question on this topic, I am planning to add other classes related to the employee like , a table for attendance and a table for payroll, then for the employee to view only his own attendance and payroll then I will need to put the ListViewFilter for the Attendance and payroll class right? for example do I need to do this on these two classes [DefaultClassOptions] Public class Attendance ; XpObject [DefaultClassOptions] Public class Payroll; XpObject Is this the important code 'ListViewFilter("CurrentUser", "[CurrentUsername]" = [RegistryUserName]", true)" for me to be able to filter the records on Thanks so much for being very patient to me! I appreciate so much your help | |
doorscomputers | Hi, Attached files: | |
doorscomputers | I forgot to pest the video Link | |
Sasha (Xafari Support)Client | Hello,
Firstly, if you want set filters to each views, you can use attribute [ListViewFilter], or use the filter from the Model, or create ViewController. [ListViewFilter("Current User", "[Employee.Oid]=CurrentUserId()", true)] You can see the details in attached video.
Feel free to contact us if you have any questions. Attached files: | |
doorscomputers | Wow!!!! Thank you so much for the great support from xafari , Thanks very much Sasha. Thanks so much for the patience in answering all my newbie questions. The last video is what I am trying to accomplish, all the previous video tutorials are also very helpful. |