You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
460 B

8 months ago
/**
* @see https://umijs.org/docs/max/access#access
* */
export default function access(initialState: { currentUser?: API.MatrixAdmin } | undefined) {
8 months ago
const { currentUser } = initialState ?? {};
let data = {
canAdmin: currentUser && currentUser.role && currentUser.role <= 3,
superAdmin: currentUser && currentUser.role && currentUser.role === 1,
canDeviceOwner: currentUser && currentUser.role && currentUser.role > 3,
8 months ago
};
return data;
8 months ago
}