Skip to content

Commit

Permalink
Merge remote-tracking branch 'couchbase/unstable' into HEAD
Browse files Browse the repository at this point in the history
http: //ci-eventing.northscale.in/eventing-11.11.2021-01.13.pass.html
Change-Id: I5217cd52a75abe8f7f50b9adb868ded797880166
  • Loading branch information
AnkitPrabhu committed Nov 11, 2021
2 parents d7edd12 + 2fc8a75 commit 913a484
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
8 changes: 5 additions & 3 deletions rbac/rbac.go
Expand Up @@ -34,12 +34,14 @@ const (
EventingManagePermission = "cluster.eventing.functions!manage"
EventingPermissionStats = "cluster.admin.internal.stats!read"
ClusterPermissionRead = "cluster.admin.security!read"
EventingAnyPermission = "cluster.collection[.:.:].eventing.function!manage"
)

var (
EventingPermissionManage = []string{EventingManagePermission}
EventingReadPermissions = []string{EventingManagePermission, ClusterPermissionRead}
EventingStatsPermission = []string{EventingPermissionStats}
EventingPermissionManage = []string{EventingManagePermission}
EventingReadPermissions = []string{EventingManagePermission, ClusterPermissionRead}
EventingStatsPermission = []string{EventingPermissionStats}
EventingAnyManageReadPermissions = []string{EventingManagePermission, ClusterPermissionRead, EventingAnyPermission}
)

func GetPermissions(keySpace *common.Keyspace, perm Permission) (perms []string) {
Expand Down
2 changes: 1 addition & 1 deletion service_manager/http_handlers.go
Expand Up @@ -2683,7 +2683,7 @@ func (m *ServiceMgr) configHandler(w http.ResponseWriter, r *http.Request) {
logPrefix := "ServiceMgr::configHandler"

w.Header().Set("Content-Type", "application/json")
if !rbac.ValidateAuthForOp(w, r, rbac.EventingReadPermissions, rbac.EventingPermissionManage, false) {
if !rbac.ValidateAuthForOp(w, r, rbac.EventingAnyManageReadPermissions, rbac.EventingPermissionManage, false) {
return
}

Expand Down
23 changes: 14 additions & 9 deletions ui/eventing-ui/ui-current/eventing.js
Expand Up @@ -977,16 +977,21 @@ angular.module('eventing', [
self.saveSettings = function(closeDialog) {
ApplicationService.public.updateConfig({
enable_debugger: self.enableDebugger
}).then(function(response) {
if ($stateParams.appName) {
let app = ApplicationService.local.getAppByName($stateParams
.appName);
$rootScope.debugDisable = !(app.settings.deployment_status && app
.settings.processing_status) || !self.enableDebugger;
closeDialog('ok');
} else {
closeDialog('ok');
}
}).catch(function(errResponse) {
ApplicationService.server.showErrorAlert("Error in storing config changes: " +
JSON.stringify(errResponse.data));
closeDialog('error');
});
if ($stateParams.appName) {
let app = ApplicationService.local.getAppByName($stateParams
.appName);
$rootScope.debugDisable = !(app.settings.deployment_status && app
.settings.processing_status) || !self.enableDebugger;
closeDialog('ok');
} else {
closeDialog('ok');
}
};
}
])
Expand Down

0 comments on commit 913a484

Please sign in to comment.