I am working on a project module that's titled Training Management. It lets a user sign in using default user role, using custom built APIs for employee authentication provided by the organization. Module's functionality includes adding users, training categories and trainings. When adding trainings, user must add trainer for a specific training, which is stored in Trainings entity as shown in the attached figure of Domain Model. When the trainer to a specific training is logged in, he should be able to mark attendance using 'Attendance' radio buttons input widget on the details page. Details page is similar for all users, and attendance radio buttons should not be visible to users other than trainer. I want to match current logged-in user's ID with the ID of trainer that I have stored in the database, and if they match, radio button input widget should be visible, otherwise not. Note: I already have used xPath constraint that matches current user with trainer in DB but I cannot seem to get it working. XPath used: [Skills_Improvement_Mgt.Attendees_Trainings/Skills_Improvement_Mgt.Trainings/Trainer='[%CurrentUser%].Name']
You have to add an association from Training User or Account and change the XPATH to
You may try $currentUser instead if you don't want to create that association. $currentUser is an object.
Chris de Gelder
There is no relation between trainer and user. User entity is used to store list of users that can later be invited to trainings. Trainer does not have a separate table. Only his employee ID is being stored in Training table, which can be used by API to get detailed information. Everything is fit right in the screenshots.
Issue is, trainer for one training could possibly be an attendee to another meeting. And all of this needs to be managed using a single user role. The only change is that trainer of a meeting should be able to see attendance radio buttons and close the training, whereas other user should only be able to see list of attendees and no attendance buttons.