mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
21 lines
592 B
JavaScript
21 lines
592 B
JavaScript
import { User } from '../../config';
|
|
|
|
// Description: Will render the component is the current user in the project is admin.
|
|
// Params
|
|
// params 1: props
|
|
// returns JSX.Element or NULL
|
|
export default function(currentProject) {
|
|
|
|
var userId = User.getUserId();
|
|
if (
|
|
userId && currentProject &&
|
|
currentProject.users &&
|
|
currentProject.users.length > 0 &&
|
|
currentProject.users.filter(user => user.userId === userId
|
|
&& (user.role !== 'Administrator' || user.role !== 'Owner')).length > 0
|
|
) {
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
} |