feat: guest + user permissions

This commit is contained in:
Nicolas Giard
2019-01-06 22:03:34 -05:00
parent aa57ea920e
commit 75eb277401
33 changed files with 463 additions and 191 deletions

View File

@@ -6,14 +6,14 @@
img(src='/svg/icon-rest-api.svg', alt='API', style='width: 80px;')
.admin-header-title
.headline.blue--text.text--darken-2 API
.subheading.grey--text Manage keys to access the API
.subheading.grey--text Manage keys to access the API #[v-chip(label, color='primary', small).white--text coming soon]
v-spacer
v-btn(outline, color='grey', large, @click='refresh')
v-btn(outline, color='grey', large, @click='refresh', disabled)
v-icon refresh
v-btn(color='green', dark, depressed, large, @click='globalSwitch')
v-btn(color='green', disabled, depressed, large, @click='globalSwitch')
v-icon(left) power_settings_new
| Enable API
v-btn(color='primary', depressed, large, @click='newKey')
v-btn(color='primary', depressed, large, @click='newKey', disabled)
v-icon(left) add
| New API Key
v-card.mt-3
@@ -58,7 +58,7 @@
td {{ props.item.updatedOn }}
td: v-btn(icon): v-icon.grey--text.text--darken-1 more_horiz
template(slot='no-data')
v-alert.mt-3(icon='warning', :value='true', outline) No API have been generated yet.
v-alert.mt-3(icon='info', :value='true', outline, color='info') No API have been generated yet.
.text-xs-center.py-2
v-pagination(v-model='pagination.page', :length='pages')
</template>

View File

@@ -207,6 +207,11 @@ export default {
await this.$apollo.mutate({
mutation: strategiesSaveMutation,
variables: {
config: {
audience: this.jwtAudience,
tokenExpiration: this.jwtExpiration,
tokenRenewal: this.jwtRenewablePeriod
},
strategies: this.strategies.map(str => _.pick(str, [
'isEnabled',
'key',

View File

@@ -7,8 +7,18 @@
.admin-header-title
.headline.primary--text Developer Tools
.subheading.grey--text ¯\_()_/¯
v-spacer
v-card.radius-7
v-card-text
.caption Enables extra dev options and removes many safeguards.
.caption.red--text Do not enable unless you know what you're doing!
v-switch.mt-1(
color='primary'
hide-details
label='Dev Mode'
)
v-card.mt-3
v-card.mt-3.white.grey--text.text--darken-3
v-tabs(
v-model='selectedTab'
color='grey darken-2'
@@ -92,9 +102,8 @@ export default {
}, 500)
return resp
},
query: '',
response: null,
variables: null,
variables: '{}',
operationName: null,
websocketConnectionParams: null
}),
@@ -103,6 +112,7 @@ export default {
graphiQLInstance.queryEditorComponent.editor.refresh()
graphiQLInstance.variableEditorComponent.editor.refresh()
graphiQLInstance.state.variableEditorOpen = true
graphiQLInstance.state.docExplorerOpen = true
},
renderVoyager() {
ReactDOM.render(
@@ -120,7 +130,7 @@ export default {
<style lang='scss'>
#graphiql {
height: calc(100vh - 230px);
height: calc(100vh - 270px);
.topBar {
background-color: mc('grey', '200');
@@ -136,10 +146,14 @@ export default {
background-color: initial;
box-shadow: initial;
}
.doc-explorer-title-bar, .history-title-bar {
height: auto;
}
}
#voyager {
height: calc(100vh - 250px);
height: calc(100vh - 270px);
.title-area {
display: none;
@@ -147,5 +161,22 @@ export default {
.type-doc {
margin-top: 5px;
}
.doc-navigation {
> span {
overflow-y: hidden;
display: block;
}
min-height: 40px;
}
.contents {
padding-bottom: 0;
color: #666;
}
.type-info-popover {
display: none;
}
}
</style>

View File

@@ -38,6 +38,8 @@
:counter='50'
v-model='config.title'
prepend-icon='public'
hint='Displayed in the top bar and appended to all pages meta title.'
persistent-hint
)
v-divider
v-subheader SEO
@@ -48,6 +50,8 @@
:counter='255'
v-model='config.description'
prepend-icon='explore'
hint='Default description when none is provided for a page.'
persistent-hint
)
v-select.mt-2(
outline
@@ -57,7 +61,7 @@
v-model='config.robots'
prepend-icon='explore'
:return-object='false'
hint='Default: Index, Follow'
hint='Default: Index, Follow. Can also be set on a per-page basis.'
persistent-hint
)
v-divider
@@ -69,6 +73,8 @@
:items='analyticsServices'
v-model='config.analyticsService'
prepend-icon='timeline'
persistent-hint
hint='Automatically add tracking code for services like Google Analytics.'
)
v-text-field.mt-2(
v-if='config.analyticsService !== ``'

View File

@@ -60,14 +60,14 @@ export default {
},
{
permission: 'write:pages',
hint: 'Can view and create new pages, as specified in the Page Rules',
hint: 'Can create new pages, as specified in the Page Rules',
warning: false,
restrictedForSystem: false,
disabled: false
},
{
permission: 'manage:pages',
hint: 'Can view, create, edit and move existing pages as specified in the Page Rules',
hint: 'Can edit and move existing pages as specified in the Page Rules',
warning: false,
restrictedForSystem: false,
disabled: false
@@ -95,7 +95,7 @@ export default {
},
{
permission: 'manage:assets',
hint: 'Can edit and delete assets (such as images and files), as specified in the Page Rules',
hint: 'Can edit and delete existing assets (such as images and files), as specified in the Page Rules',
warning: false,
restrictedForSystem: false,
disabled: false
@@ -116,7 +116,7 @@ export default {
},
{
permission: 'manage:comments',
hint: 'Can edit and delete comments, as specified in the Page Rules',
hint: 'Can edit and delete existing comments, as specified in the Page Rules',
warning: false,
restrictedForSystem: false,
disabled: false

View File

@@ -52,6 +52,8 @@
v-toolbar(color='primary', dark, dense, flat)
v-toolbar-title
.subheading {{ $t('admin:locale.namespacing') }}
v-spacer
v-chip(label, color='white', small).primary--text coming soon
v-card-text
v-switch(
v-model='namespacing'

View File

@@ -6,11 +6,11 @@
img(src='/svg/icon-registry-editor.svg', alt='Logging', style='width: 80px;')
.admin-header-title
.headline.primary--text Logging
.subheading.grey--text Configure the system logger(s)
.subheading.grey--text Configure the system logger(s) #[v-chip(label, color='primary', small).white--text coming soon]
v-spacer
v-btn(outline, color='grey', @click='refresh', large)
v-icon refresh
v-btn(color='black', dark, depressed, @click='toggleConsole', large)
v-btn(color='black', disabled, depressed, @click='toggleConsole', large)
ConsoleLineIcon.mr-3
span Live Trail
v-btn(color='success', @click='save', depressed, large)
@@ -34,6 +34,7 @@
:label='logger.title'
color='primary'
hide-details
disabled
)
v-tab-item(v-for='(logger, n) in activeLoggers', :key='logger.key', :transition='false', :reverse-transition='false')

View File

@@ -6,7 +6,7 @@
img(src='/svg/icon-search.svg', alt='Search Engine', style='width: 80px;')
.admin-header-title
.headline.primary--text Search Engine
.subheading.grey--text Configure the search capabilities of your wiki
.subheading.grey--text Configure the search capabilities of your wiki #[v-chip(label, color='primary', small).white--text coming soon]
v-spacer
v-btn(outline, color='grey', @click='refresh', large)
v-icon refresh

View File

@@ -6,7 +6,7 @@
img(src='/svg/icon-cloud-storage.svg', alt='Storage', style='width: 80px;')
.admin-header-title
.headline.primary--text Storage
.subheading.grey--text Set backup and sync targets for your content
.subheading.grey--text Set backup and sync targets for your content #[v-chip(label, color='primary', small).white--text coming soon]
v-spacer
v-btn(outline, color='grey', @click='refresh', large)
v-icon refresh