Skip to content

Commit

Permalink
MB-51147: showAddView should depend on hasWritePermission
Browse files Browse the repository at this point in the history
ADD VIEW button should be hidden in case useer has no
permissions.cluster.bucket[bucket].views!write permission

Change-Id: I2338febedddf8c45891204300f818b4fe049688d
Reviewed-on: https://review.couchbase.org/c/ns_server/+/171788
Tested-by: Pavel Blagodov <stochmail@gmail.com>
Well-Formed: Build Bot <build@couchbase.com>
Reviewed-by: Matthew Dawber <matthew.dawber@couchbase.com>
  • Loading branch information
pavel-blagodov committed Mar 4, 2022
1 parent e09859d commit 75d1675
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions priv/public/ui/app/mn.views.list.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,11 @@ class MnViewsListComponent extends MnLifeCycleHooksToStream {
this.showAddView =
combineLatest(this.isDevelopmentViews,
this.bucketsMembaseCouchstore,
this.commonBucket)
.pipe(map(([isDevViews, buckets, commonBucket]) => {
this.commonBucket,
this.hasWritePermission)
.pipe(map(([isDevViews, buckets, commonBucket, hasWritePermission]) => {

if (!isDevViews || !buckets.length) {
if (!isDevViews || !buckets.length || !hasWritePermission) {
return;
}

Expand Down

0 comments on commit 75d1675

Please sign in to comment.