# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0

import logging
import re

from c7n.filters import Filter, FilterValidationError, ValueFilter
from c7n.filters.related import RelatedResourceFilter
from c7n.query import sources
from c7n.resources import load_resources
from c7n.utils import local_session, type_schema
from c7n_azure.actions.base import AzureBaseAction
from c7n_azure.constants import GRAPH_AUTH_ENDPOINT
from c7n_azure.provider import Azure, resources
from c7n_azure.query import DescribeSource, QueryResourceManager
from c7n_azure.utils import GraphHelper

log = logging.getLogger('custodian.azure.access_control')


@resources.register('roleassignment')
class RoleAssignment(QueryResourceManager):
    """Role assignments map role definitions to principals. The Azure
    object only contains the unique ID of the principal, however we
    attempt to augment the object with the prinicpal name, display name
    and type from AAD.