ng-disabled="edit_passthru.hide_save_actions()"
ng_click="edit_passthru.save({clone:true})">[% l('Save & Clone') %]</button>
</span>
+ <div class="alert alert-warning" ng-show="edit_passthru.self_edit_disallowed()">
+ [% l('Editing your own account is disallowed') %]
+ </div>
+ <div class="alert alert-warning" ng-show="edit_passthru.group_edit_disallowed()">
+ [% l('Editing users in this group is disallowed') %]
+ </div>
</div>
return !egCore.org.CanHaveVolumes(org_id);
}
- // Returns true if the Save and Save & Clone buttons should be disabled.
- $scope.edit_passthru.hide_save_actions = function() {
+ // Returns true if attempting to edit self, but perms don't allow
+ $scope.edit_passthru.self_edit_disallowed = function() {
if ($scope.patron.id
&& $scope.patron.id == egCore.auth.user().id()
&& !$scope.perms.EDIT_SELF_IN_CLIENT
) return true;
+ return false;
+ }
+ // Returns true if attempting to edit a user without appropriate group application perms
+ $scope.edit_passthru.group_edit_disallowed = function() {
if ( $scope.patron.profile
&& patronRegSvc
.edit_profiles
return $scope.patron.profile.id() == p.id();
}).length == 0
) return true;
+ return false;
+ }
+
+ // Returns true if the Save and Save & Clone buttons should be disabled.
+ $scope.edit_passthru.hide_save_actions = function() {
+ if ($scope.edit_passthru.self_edit_disallowed()) return true;
+ if ($scope.edit_passthru.group_edit_disallowed()) return true;
return $scope.patron.isnew ?
!$scope.perms.CREATE_USER :
);
}
+ $scope.edit_passthru.self_edit_disallowed = function() {
+ return false;
+ }
+
+ $scope.edit_passthru.group_edit_disallowed = function() {
+ return false;
+ }
+
// Returns true if the Save and Save & Clone buttons should be disabled.
$scope.edit_passthru.hide_save_actions = function() {
return false;