forked from tabarra/txAdmin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
87 additions
and
478 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,18 @@ | ||
## Permission System | ||
Introduced in **txAdmin** v1.5.0, the permission system allows you to control which admins can perform which actions. | ||
The permission system allows you to control which admins can perform which actions. | ||
For instance you can allow one admin to only view the console and kick players, but not restart the server and execute arbitrary commands. | ||
The permissions are saved in the `data/admins.json` file and can be edited through the *Admin Manager* page by users with `all` or `manage.admins` permissions. | ||
Any accounts created with the `admin-add` script will be created with all permissions. | ||
|
||
**Note:** There is no "root" account, so an account with the `manage.admins` permission could delete the account that created him. | ||
The permissions are saved in the `txData/admins.json` file and can be edited through the *Admin Manager* page by the Master admin, or users with `all_permissions` or `manage.admins` permissions. | ||
|
||
### Available Permissions | ||
- `all`: Root permission that allows the user to perform any action. When set, this will remove all other permissions; | ||
- `all_permissions`: Root permission that allows the user to perform any action. When set, this will remove all other permissions; | ||
- `manage.admins`: Permission to create, edit and remove other admin accounts; | ||
- `settings.view`: Permission to view the settings; | ||
- `settings.write`: Permission to edit the settings; | ||
- `control.server`: Permission to start/stop/restart the server; | ||
- `commands.message`: Permission to send admin messages via DM or Broadcast command; | ||
- `commands.kick`: Permission to kick one or all players; | ||
- `commands.resources`: Permission to start/ensure/restart/stop resources; | ||
- `commands.kick`: Permission to kick one or all players; | ||
- `commands.message`: Permission to send admin messages via DM or Broadcast command; | ||
- `commands.custom`: Permission to execute any of the custom commands (**not implemented yet**); | ||
- `console.view`: Permission to view the Live Console; | ||
- `console.write`: Permission to execute commands in the Live Console. | ||
- `server.cfg.editor`: Permission to view and edit the FXServer CFG File (eg `server.cfg`). |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
//Require | ||
const xssClass = require('xss'); | ||
|
||
// console.dir(xss.whiteList) | ||
//Set custom xss rules | ||
|
||
|
||
module.exports = (incWL = []) => { | ||
/** | ||
* Returns a function with the passed whitelist parameter. | ||
* https://github.com/leizongmin/js-xss#whitelist | ||
*/ | ||
module.exports = (customWL = []) => { | ||
const xss = new xssClass.FilterXSS({ | ||
whiteList: incWL | ||
whiteList: customWL | ||
}); | ||
return (x) => {return xss.process(x)} | ||
return (x) => {return xss.process(x)}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.