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.
12 lines
460 B
12 lines
460 B
/**
|
|
* @see https://umijs.org/docs/max/access#access
|
|
* */
|
|
export default function access(initialState: { currentUser?: API.MatrixAdmin } | undefined) {
|
|
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,
|
|
};
|
|
return data;
|
|
}
|
|
|