mirror of
https://gitea.com/Lydanne/issues-helper.git
synced 2025-08-22 11:45:48 +08:00
refactor: rename allow-permissions (#48)
* refactor: rename allow-permissions * up
This commit is contained in:
13
src/util.js
13
src/util.js
@@ -46,10 +46,23 @@ function getPreMonth(m) {
|
||||
return m == 1 ? 12 : m - 1;
|
||||
}
|
||||
|
||||
function checkPermission(require, permission) {
|
||||
/**
|
||||
* 有权限返回 true
|
||||
*/
|
||||
const permissions = ['none', 'read', 'write', 'admin'];
|
||||
const requireNo = permissions.indexOf(require);
|
||||
const permissionNo = permissions.indexOf(permission);
|
||||
|
||||
return requireNo <= permissionNo;
|
||||
}
|
||||
|
||||
// **********************************************************
|
||||
module.exports = {
|
||||
dealStringToArr,
|
||||
dealRandomAssignees,
|
||||
getPreMonth,
|
||||
matchKeyword,
|
||||
testDuplicate,
|
||||
checkPermission,
|
||||
};
|
||||
|
Reference in New Issue
Block a user