Ability to invite others to an appointment for users with Manage Own Appointments privilege

Hi All,

In the current bahmni appointments system while Scheduling/Editing an appointment, the user can only invite others if they have the privilege to manage everyones appointment and NOT just the privilege to manage own appointments.

This is because the provider list is filtered based on the privilege

var providerListForCurrentUser = function (providers) {
                if (appointmentCommonService.isCurrentUserHavingPrivilege(Bahmni.Appointments.Constants.privilegeManageAppointments, $rootScope.currentUser.privileges)) {
                    return providers;
                }
                if (appointmentCommonService.isCurrentUserHavingPrivilege(Bahmni.Appointments.Constants.privilegeOwnAppointments, $rootScope.currentUser.privileges)) {
                    return _.filter(providers, function (provider) {
                        return provider.uuid === $rootScope.currentProvider.uuid;
                    });
                }
                return providers;
            };

As a new feature we want the ability for a user to invite others even thought the person does not have the privilege to manage appointments for everyone.

Currently there are Two approaches we can thing of -

  1. Remove the filtering based on privileges (In this case every one will have the ability to add multiple providers even with privilege to only manage own appointments).
  2. Add a new privilege (Schedule Other’s Appointments) that will give a user the ability to invite other and not filter the providers if the user have the privilege.

Please let us know what is the preferred approach and/or if there are any better ways of dong it.

@angshuonline @snehabagri @mksd

cc: @rrameshbtech @mddubey

3 Likes

Moved to the bahmni category.

Raised the PR.

Can Someone please review this.