mirror of
https://github.com/jc21/nginx-proxy-manager.git
synced 2024-08-30 18:22:48 +00:00
valite auth/access rules in backend
This commit is contained in:
parent
e9e5d293cc
commit
005e64eb9f
@ -25,6 +25,10 @@ const internalAccessList = {
|
|||||||
create: (access, data) => {
|
create: (access, data) => {
|
||||||
return access.can('access_lists:create', data)
|
return access.can('access_lists:create', data)
|
||||||
.then((/*access_data*/) => {
|
.then((/*access_data*/) => {
|
||||||
|
if ((typeof data.items === 'undefined' || !data.items.length) && (typeof data.clients === 'undefined' || !data.clients.length)) {
|
||||||
|
throw new error.InternalValidationError('At leaste one user/pass or address must be defined');
|
||||||
|
}
|
||||||
|
|
||||||
return accessListModel
|
return accessListModel
|
||||||
.query()
|
.query()
|
||||||
.omit(omissions())
|
.omit(omissions())
|
||||||
@ -110,6 +114,10 @@ const internalAccessList = {
|
|||||||
update: (access, data) => {
|
update: (access, data) => {
|
||||||
return access.can('access_lists:update', data.id)
|
return access.can('access_lists:update', data.id)
|
||||||
.then((/*access_data*/) => {
|
.then((/*access_data*/) => {
|
||||||
|
if ((typeof data.items === 'undefined' || !data.items.length) && (typeof data.clients === 'undefined' || !data.clients.length)) {
|
||||||
|
throw new error.InternalValidationError('At leaste one user/pass or address must be defined');
|
||||||
|
}
|
||||||
|
|
||||||
return internalAccessList.get(access, {id: data.id});
|
return internalAccessList.get(access, {id: data.id});
|
||||||
})
|
})
|
||||||
.then((row) => {
|
.then((row) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user