mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-15 09:46:16 +01:00
user with write permission on namespacesPermissions may also read the namespacePermissions so it is consistent to other permissions
This commit is contained in:
@@ -617,9 +617,9 @@ export function getDeleteRepoFailure(state: object, namespace: string, name: str
|
||||
export function getPermissionsLink(state: object, namespaceName: string, repoName?: string) {
|
||||
if (repoName) {
|
||||
const repo = getRepository(state, namespaceName, repoName);
|
||||
return repo && repo._links ? repo._links.permissions.href : undefined;
|
||||
return repo?._links ? repo._links.permissions.href : undefined;
|
||||
} else {
|
||||
const namespace = getNamespace(state, namespaceName);
|
||||
return namespace && namespace._links ? namespace._links.permissions.href : undefined;
|
||||
return namespace?._links ? namespace?._links?.permissions?.href : undefined;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ type Props = WithTranslation & {
|
||||
|
||||
class PermissionsNavLink extends React.Component<Props> {
|
||||
hasPermissionsLink = () => {
|
||||
return this.props.namespace._links.permissions;
|
||||
return this.props.namespace?._links?.permissions;
|
||||
};
|
||||
render() {
|
||||
if (!this.hasPermissionsLink()) {
|
||||
|
||||
Reference in New Issue
Block a user