package com.atlassian.stash.experimental.user;

import com.atlassian.annotations.ExperimentalApi;
import com.atlassian.bitbucket.project.Project;
import com.atlassian.bitbucket.permission.Permission;

import javax.annotation.Nonnull;

/**
 * Defines an association between a {@link Project} and the {@link Permission} granted to a user or group to access it.
 *
 * WARNING: this interface is experimental and is subject to change between minor versions of Stash up to and including
 * removal of this interface or parts thereof. It is not for consumption by non-Atlassian plugins and no consideration
 * will be given to nor guarantees made for its compatibility between releases. Basically, don't use it unless
 * you're a Stash developer.
 *
 * @see RepositoryPermission
 */
@ExperimentalApi
public interface ProjectPermission {
    /**
     * @return the project the user or group has been granted access to
     */
    @Nonnull
    Project getProject();

    /**
     * @return the permission granted to the user or group to access the project
     */
    @Nonnull
    Permission getPermission();
}
