Xafari Security Based on Loggedin User

StatusIDPriorityType
Closed24595CriticalQuestion
ProfileReply
doorscomputersClient

I had submitted a ticket before and it was solved , here is the link https://galaktika-soft.com/tickets/display-records-based-on-login-user
However, I am having a problem because the records on the attendance class cannot be edited because it is per logged in user. How can I let the admin display and edit all the records or set a user as the data entry operator to edit the attendance of other users. The problem with the solution is that it can only display records based on the loggedin user wgich means even the admin cannot display and edit the records of other users, How can I enable a user to edit other records using the xafari security? Thanks very much!

Replies

UserDescriptionPosted On
Sasha (Xafari Support)Client

Hello,
We are working on your issue and it will take some additional time.
Thanks,Sasha.

Sasha (Xafari Support)Client

Hi,
My apologies for the delay.

To solve your issue you have to set the [NonPersistent] attribute to the CurrentUserName property your classes (see attached file TestSecuritySolution.zip from ticket Display Records Based on Login User):

[NonPersistent]

[VisibleInListView(false), VisibleInDetailView(false), VisibleInLookupListView(false)]

public string CurrentUserName

{

get { return SecuritySystem.CurrentUserName; }

}

and change your [ListViewFilter] attribute:

[ListViewFilter("Current User", "[CurrentUserName] = [RegistryUserName] Or [CurrentUserName] = 'admin'", true)]

 

Feel free to contact us if you experience any further difficulties.
Regards, Sasha.

doorscomputers

Hi, Thanks so much for the reply. I tried the code but I cannot display the previously entered records for the other employee but I can add. I want to display the records by other users if I log in as admin and can enter new ones, the above code seems to be good if I add records only . May I kindly request how to see all records and edit them if I am the admin? Thanks!

Sasha (Xafari Support)Client

Hello,

 

We advise you to clean your project and build the project.
And you can test the code on a new base and test only change [ListViewFilter]:

[ListViewFilter("Current User", "[CurrentUserName] = [RegistryUserName] Or [CurrentUserName] = 'admin'", true)]

 

Feel free to contact us if you experience any further difficulties.

Regards, Sasha.

doorscomputers

Hi Sasha. Thanks for the Reply. I did and still I cannot accomplish it. May I kindly request if you can modify again the video you sent me before showing how it works? The first solution was fine but the problem is that I cannot edit records anymore because they are filtered per user based on our example, I want to exclude the admin but it does not work on my part I am sure I am missing something here.

Sasha (Xafari Support)Client

Hello,

This issue does not contain Xafari functions, so we reccomend you to explore DevExpress capabilities (Ticket System DevExpress - you may found your question in the base of tickets).

To the issue in the ticket you can add your ViewController and track actions admin or other users.

Regards, Sasha.

× This ticket is closed.

Write US