File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,10 @@ const internalAccessList = {
2525 create : ( access , data ) => {
2626 return access . can ( 'access_lists:create' , data )
2727 . then ( ( /*access_data*/ ) => {
28+ if ( ( typeof data . items === 'undefined' || ! data . items . length ) && ( typeof data . clients === 'undefined' || ! data . clients . length ) ) {
29+ throw new error . InternalValidationError ( 'At leaste one user/pass or address must be defined' ) ;
30+ }
31+
2832 return accessListModel
2933 . query ( )
3034 . omit ( omissions ( ) )
@@ -110,6 +114,10 @@ const internalAccessList = {
110114 update : ( access , data ) => {
111115 return access . can ( 'access_lists:update' , data . id )
112116 . then ( ( /*access_data*/ ) => {
117+ if ( ( typeof data . items === 'undefined' || ! data . items . length ) && ( typeof data . clients === 'undefined' || ! data . clients . length ) ) {
118+ throw new error . InternalValidationError ( 'At leaste one user/pass or address must be defined' ) ;
119+ }
120+
113121 return internalAccessList . get ( access , { id : data . id } ) ;
114122 } )
115123 . then ( ( row ) => {
You can’t perform that action at this time.
0 commit comments