package com.atlassian.stash.experimental.user;

import com.atlassian.annotations.ExperimentalApi;
import com.atlassian.bitbucket.permission.Permission;
import com.atlassian.bitbucket.repository.Repository;

import javax.annotation.Nonnull;

/**
 * Defines an association between a {@link Repository} 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 ProjectPermission
 */
@ExperimentalApi
public interface RepositoryPermission {
    /**
     * @return the repository the user or group has been granted access to
     */
    @Nonnull
    Repository getRepository();

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