Update permissions checking code

This commit is contained in:
Dane Everitt
2020-03-29 14:19:17 -07:00
parent 2e9d327dfc
commit 8bc81c8c4b
7 changed files with 79 additions and 43 deletions

View File

@@ -8,6 +8,7 @@ import UserRow from '@/components/server/users/UserRow';
import FlashMessageRender from '@/components/FlashMessageRender';
import getServerSubusers from '@/api/server/users/getServerSubusers';
import { httpErrorToHuman } from '@/api/http';
import Can from '@/components/elements/Can';
export default () => {
const [ loading, setLoading ] = useState(true);
@@ -53,9 +54,11 @@ export default () => {
<UserRow key={subuser.uuid} subuser={subuser}/>
))
}
<div className={'flex justify-end mt-6'}>
<AddSubuserButton/>
</div>
<Can action={'user.create'}>
<div className={'flex justify-end mt-6'}>
<AddSubuserButton/>
</div>
</Can>
</div>
);
};