All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.nemerosa.ontrack.ui.resource.ResourceContext Maven / Gradle / Ivy

There is a newer version: 4.4.5
Show newest version
package net.nemerosa.ontrack.ui.resource;

import net.nemerosa.ontrack.model.security.GlobalFunction;
import net.nemerosa.ontrack.model.security.ProjectFunction;
import net.nemerosa.ontrack.model.structure.ProjectEntity;

import java.net.URI;

public interface ResourceContext {

    /**
     * @see net.nemerosa.ontrack.ui.controller.URIBuilder#build(Object)
     */
    URI uri(Object methodInvocation);

    /**
     * Gets a builder for links
     */
    LinksBuilder links();

    /**
     * Checks if the fn function is granted for the current user
     * for the projectId project.
     */
    boolean isProjectFunctionGranted(int projectId, Class fn);

    /**
     * Checks if the fn function is granted for the current user
     * for the projectEntity's project.
     */
    default boolean isProjectFunctionGranted(ProjectEntity projectEntity, Class fn) {
        return isProjectFunctionGranted(projectEntity.projectId(), fn);
    }

    /**
     * Checks if the fn function is granted for the current user.
     */
    boolean isGlobalFunctionGranted(Class fn);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy