!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/wincloud_gateway/node_modules/strapi-admin/domain/condition/   drwxr-xr-x
Free 13.25 GB of 57.97 GB (22.86%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     index.js (2.48 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
'use strict';

const { pipe, merge, set, pick } = require('lodash/fp');

/**
 * The handler of a {@link Condition}
 * @typedef {(function(user: Object, options: Object): Object | boolean)} ConditionHandler
 */
/**
 * Domain representation of a Condition (RBAC)
 * @typedef {Object} Condition
 * @property {string} id - The identifier of the condition
 * @property {string} displayName - The display name of a condition
 * @property {string} name - The name of a condition
 * @property {string} [plugin] - The plugin which provide the condition
 * @property {string} [category] - The main category of a condition
 * @property {ConditionHandler} handler - The handler of a condition
 */

/**
 * Set of attributes used to create a new {@link Action} object
 * @typedef {Condition, { uid: string }} CreateConditionPayload
 */

const DEFAULT_CATEGORY = 'default';

/**
 * Get the default value used for every condition
 * @return {Condition}
 */
const getDefaultConditionAttributes = () => ({
  category: DEFAULT_CATEGORY,
});

/**
 * Get the list of all the valid attributes of a {@link Condition}
 * @return {string[]}
 */
const conditionFields = ['id', 'displayName', 'handler', 'plugin', 'category'];

/**
 * Remove unwanted attributes from a {@link Condition}
 * @type {function(action: Condition | CreateConditionPayload): Condition}
 */
const sanitizeConditionAttributes = pick(conditionFields);

/**
 *
 * @param condition
 * @return {string}
 */
const computeConditionId = condition => {
  const { name, plugin } = condition;

  if (!plugin) {
    return `application::${name}`;
  }

  if (plugin === 'admin') {
    return `admin::${name}`;
  }

  return `plugins::${plugin}.${name}`;
};

/**
 * Assign an id attribute to a {@link CreateConditionPayload} object
 * @param {CreateConditionPayload} attrs - Payload used to create a condition
 * @return {CreateConditionPayload}
 */
const assignConditionId = attrs => set('id', computeConditionId(attrs), attrs);

/**
 * Transform the given attributes into a domain representation of a Condition
 * @type (function(CreateConditionPayload): Condition)
 * @param {CreateConditionPayload} payload - The condition payload containing the attributes needed to create a {@link Condition}
 * @return {Condition}
 */
const create = pipe(
  assignConditionId,
  sanitizeConditionAttributes,
  merge(getDefaultConditionAttributes())
);

module.exports = {
  assignConditionId,
  computeConditionId,
  conditionFields,
  create,
  getDefaultConditionAttributes,
  sanitizeConditionAttributes,
};

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0045 ]--