mirror of
				https://github.com/BookStackApp/BookStack.git
				synced 2025-11-03 02:13:16 +03:00 
			
		
		
		
	Nothing on back-end logic done to hook this new option up. Addition of permissions for role_id=0 works out of the box, but active "everyone else" permissions, with no priviliges, is currently not working. Needs change of permission gen logic also.
		
			
				
	
	
		
			24 lines
		
	
	
		
			615 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			615 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
 | 
						|
 | 
						|
class EntityPermissions {
 | 
						|
 | 
						|
    setup() {
 | 
						|
        this.everyoneInheritToggle = this.$refs.everyoneInherit;
 | 
						|
 | 
						|
        this.setupListeners();
 | 
						|
    }
 | 
						|
 | 
						|
    setupListeners() {
 | 
						|
        this.everyoneInheritToggle.addEventListener('change', event => {
 | 
						|
            const inherit = event.target.checked;
 | 
						|
            const permissions = document.querySelectorAll('input[type="checkbox"][name^="restrictions[0]["]');
 | 
						|
            for (const permission of permissions) {
 | 
						|
                permission.disabled = inherit;
 | 
						|
                permission.checked = false;
 | 
						|
            }
 | 
						|
        })
 | 
						|
    }
 | 
						|
 | 
						|
}
 | 
						|
 | 
						|
export default EntityPermissions; |