1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. DataSafe
  5. getListUserGrants
Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi

oci.DataSafe.getListUserGrants

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi

    This data source provides the list of List User Grants in Oracle Cloud Infrastructure Data Safe service.

    Gets a list of grants for a particular user in the specified user assessment. A user grant contains details such as the privilege name, type, category, and depth level. The depth level indicates how deep in the hierarchy of roles granted to roles a privilege grant is. The userKey in this operation is a system-generated identifier. Perform the operation ListUsers to get the userKey for a particular user.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testListUserGrants = oci.DataSafe.getListUserGrants({
        userAssessmentId: testUserAssessment.id,
        userKey: listUserGrantUserKey,
        depthLevel: listUserGrantDepthLevel,
        depthLevelGreaterThanOrEqualTo: listUserGrantDepthLevelGreaterThanOrEqualTo,
        depthLevelLessThan: listUserGrantDepthLevelLessThan,
        grantKey: listUserGrantGrantKey,
        grantName: listUserGrantGrantName,
        privilegeCategory: listUserGrantPrivilegeCategory,
        privilegeType: listUserGrantPrivilegeType,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_list_user_grants = oci.DataSafe.get_list_user_grants(user_assessment_id=test_user_assessment["id"],
        user_key=list_user_grant_user_key,
        depth_level=list_user_grant_depth_level,
        depth_level_greater_than_or_equal_to=list_user_grant_depth_level_greater_than_or_equal_to,
        depth_level_less_than=list_user_grant_depth_level_less_than,
        grant_key=list_user_grant_grant_key,
        grant_name=list_user_grant_grant_name,
        privilege_category=list_user_grant_privilege_category,
        privilege_type=list_user_grant_privilege_type)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/DataSafe"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := DataSafe.GetListUserGrants(ctx, &datasafe.GetListUserGrantsArgs{
    			UserAssessmentId:               testUserAssessment.Id,
    			UserKey:                        listUserGrantUserKey,
    			DepthLevel:                     pulumi.IntRef(listUserGrantDepthLevel),
    			DepthLevelGreaterThanOrEqualTo: pulumi.IntRef(listUserGrantDepthLevelGreaterThanOrEqualTo),
    			DepthLevelLessThan:             pulumi.IntRef(listUserGrantDepthLevelLessThan),
    			GrantKey:                       pulumi.StringRef(listUserGrantGrantKey),
    			GrantName:                      pulumi.StringRef(listUserGrantGrantName),
    			PrivilegeCategory:              pulumi.StringRef(listUserGrantPrivilegeCategory),
    			PrivilegeType:                  pulumi.StringRef(listUserGrantPrivilegeType),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Oci = Pulumi.Oci;
    
    return await Deployment.RunAsync(() => 
    {
        var testListUserGrants = Oci.DataSafe.GetListUserGrants.Invoke(new()
        {
            UserAssessmentId = testUserAssessment.Id,
            UserKey = listUserGrantUserKey,
            DepthLevel = listUserGrantDepthLevel,
            DepthLevelGreaterThanOrEqualTo = listUserGrantDepthLevelGreaterThanOrEqualTo,
            DepthLevelLessThan = listUserGrantDepthLevelLessThan,
            GrantKey = listUserGrantGrantKey,
            GrantName = listUserGrantGrantName,
            PrivilegeCategory = listUserGrantPrivilegeCategory,
            PrivilegeType = listUserGrantPrivilegeType,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.DataSafe.DataSafeFunctions;
    import com.pulumi.oci.DataSafe.inputs.GetListUserGrantsArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var testListUserGrants = DataSafeFunctions.getListUserGrants(GetListUserGrantsArgs.builder()
                .userAssessmentId(testUserAssessment.id())
                .userKey(listUserGrantUserKey)
                .depthLevel(listUserGrantDepthLevel)
                .depthLevelGreaterThanOrEqualTo(listUserGrantDepthLevelGreaterThanOrEqualTo)
                .depthLevelLessThan(listUserGrantDepthLevelLessThan)
                .grantKey(listUserGrantGrantKey)
                .grantName(listUserGrantGrantName)
                .privilegeCategory(listUserGrantPrivilegeCategory)
                .privilegeType(listUserGrantPrivilegeType)
                .build());
    
        }
    }
    
    variables:
      testListUserGrants:
        fn::invoke:
          Function: oci:DataSafe:getListUserGrants
          Arguments:
            userAssessmentId: ${testUserAssessment.id}
            userKey: ${listUserGrantUserKey}
            depthLevel: ${listUserGrantDepthLevel}
            depthLevelGreaterThanOrEqualTo: ${listUserGrantDepthLevelGreaterThanOrEqualTo}
            depthLevelLessThan: ${listUserGrantDepthLevelLessThan}
            grantKey: ${listUserGrantGrantKey}
            grantName: ${listUserGrantGrantName}
            privilegeCategory: ${listUserGrantPrivilegeCategory}
            privilegeType: ${listUserGrantPrivilegeType}
    

    Using getListUserGrants

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getListUserGrants(args: GetListUserGrantsArgs, opts?: InvokeOptions): Promise<GetListUserGrantsResult>
    function getListUserGrantsOutput(args: GetListUserGrantsOutputArgs, opts?: InvokeOptions): Output<GetListUserGrantsResult>
    def get_list_user_grants(depth_level: Optional[int] = None,
                             depth_level_greater_than_or_equal_to: Optional[int] = None,
                             depth_level_less_than: Optional[int] = None,
                             filters: Optional[Sequence[_datasafe.GetListUserGrantsFilter]] = None,
                             grant_key: Optional[str] = None,
                             grant_name: Optional[str] = None,
                             privilege_category: Optional[str] = None,
                             privilege_type: Optional[str] = None,
                             user_assessment_id: Optional[str] = None,
                             user_key: Optional[str] = None,
                             opts: Optional[InvokeOptions] = None) -> GetListUserGrantsResult
    def get_list_user_grants_output(depth_level: Optional[pulumi.Input[int]] = None,
                             depth_level_greater_than_or_equal_to: Optional[pulumi.Input[int]] = None,
                             depth_level_less_than: Optional[pulumi.Input[int]] = None,
                             filters: Optional[pulumi.Input[Sequence[pulumi.Input[_datasafe.GetListUserGrantsFilterArgs]]]] = None,
                             grant_key: Optional[pulumi.Input[str]] = None,
                             grant_name: Optional[pulumi.Input[str]] = None,
                             privilege_category: Optional[pulumi.Input[str]] = None,
                             privilege_type: Optional[pulumi.Input[str]] = None,
                             user_assessment_id: Optional[pulumi.Input[str]] = None,
                             user_key: Optional[pulumi.Input[str]] = None,
                             opts: Optional[InvokeOptions] = None) -> Output[GetListUserGrantsResult]
    func GetListUserGrants(ctx *Context, args *GetListUserGrantsArgs, opts ...InvokeOption) (*GetListUserGrantsResult, error)
    func GetListUserGrantsOutput(ctx *Context, args *GetListUserGrantsOutputArgs, opts ...InvokeOption) GetListUserGrantsResultOutput

    > Note: This function is named GetListUserGrants in the Go SDK.

    public static class GetListUserGrants 
    {
        public static Task<GetListUserGrantsResult> InvokeAsync(GetListUserGrantsArgs args, InvokeOptions? opts = null)
        public static Output<GetListUserGrantsResult> Invoke(GetListUserGrantsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetListUserGrantsResult> getListUserGrants(GetListUserGrantsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:DataSafe/getListUserGrants:getListUserGrants
      arguments:
        # arguments dictionary

    The following arguments are supported:

    UserAssessmentId string
    The OCID of the user assessment.
    UserKey string
    The unique user key. This is a system-generated identifier. ListUsers gets the user key for a user.
    DepthLevel int
    A filter to return only items that match the specified user grant depth level.
    DepthLevelGreaterThanOrEqualTo int
    A filter to return only items that are at a level greater than or equal to the specified user grant depth level.
    DepthLevelLessThan int
    A filter to return only items that are at a level less than the specified user grant depth level.
    Filters List<GetListUserGrantsFilter>
    GrantKey string
    A filter to return only items that match the specified user grant key.
    GrantName string
    A filter to return only items that match the specified user grant name.
    PrivilegeCategory string
    A filter to return only items that match the specified user privilege category.
    PrivilegeType string
    A filter to return only items that match the specified privilege grant type.
    UserAssessmentId string
    The OCID of the user assessment.
    UserKey string
    The unique user key. This is a system-generated identifier. ListUsers gets the user key for a user.
    DepthLevel int
    A filter to return only items that match the specified user grant depth level.
    DepthLevelGreaterThanOrEqualTo int
    A filter to return only items that are at a level greater than or equal to the specified user grant depth level.
    DepthLevelLessThan int
    A filter to return only items that are at a level less than the specified user grant depth level.
    Filters []GetListUserGrantsFilter
    GrantKey string
    A filter to return only items that match the specified user grant key.
    GrantName string
    A filter to return only items that match the specified user grant name.
    PrivilegeCategory string
    A filter to return only items that match the specified user privilege category.
    PrivilegeType string
    A filter to return only items that match the specified privilege grant type.
    userAssessmentId String
    The OCID of the user assessment.
    userKey String
    The unique user key. This is a system-generated identifier. ListUsers gets the user key for a user.
    depthLevel Integer
    A filter to return only items that match the specified user grant depth level.
    depthLevelGreaterThanOrEqualTo Integer
    A filter to return only items that are at a level greater than or equal to the specified user grant depth level.
    depthLevelLessThan Integer
    A filter to return only items that are at a level less than the specified user grant depth level.
    filters List<GetListUserGrantsFilter>
    grantKey String
    A filter to return only items that match the specified user grant key.
    grantName String
    A filter to return only items that match the specified user grant name.
    privilegeCategory String
    A filter to return only items that match the specified user privilege category.
    privilegeType String
    A filter to return only items that match the specified privilege grant type.
    userAssessmentId string
    The OCID of the user assessment.
    userKey string
    The unique user key. This is a system-generated identifier. ListUsers gets the user key for a user.
    depthLevel number
    A filter to return only items that match the specified user grant depth level.
    depthLevelGreaterThanOrEqualTo number
    A filter to return only items that are at a level greater than or equal to the specified user grant depth level.
    depthLevelLessThan number
    A filter to return only items that are at a level less than the specified user grant depth level.
    filters GetListUserGrantsFilter[]
    grantKey string
    A filter to return only items that match the specified user grant key.
    grantName string
    A filter to return only items that match the specified user grant name.
    privilegeCategory string
    A filter to return only items that match the specified user privilege category.
    privilegeType string
    A filter to return only items that match the specified privilege grant type.
    user_assessment_id str
    The OCID of the user assessment.
    user_key str
    The unique user key. This is a system-generated identifier. ListUsers gets the user key for a user.
    depth_level int
    A filter to return only items that match the specified user grant depth level.
    depth_level_greater_than_or_equal_to int
    A filter to return only items that are at a level greater than or equal to the specified user grant depth level.
    depth_level_less_than int
    A filter to return only items that are at a level less than the specified user grant depth level.
    filters Sequence[datasafe.GetListUserGrantsFilter]
    grant_key str
    A filter to return only items that match the specified user grant key.
    grant_name str
    A filter to return only items that match the specified user grant name.
    privilege_category str
    A filter to return only items that match the specified user privilege category.
    privilege_type str
    A filter to return only items that match the specified privilege grant type.
    userAssessmentId String
    The OCID of the user assessment.
    userKey String
    The unique user key. This is a system-generated identifier. ListUsers gets the user key for a user.
    depthLevel Number
    A filter to return only items that match the specified user grant depth level.
    depthLevelGreaterThanOrEqualTo Number
    A filter to return only items that are at a level greater than or equal to the specified user grant depth level.
    depthLevelLessThan Number
    A filter to return only items that are at a level less than the specified user grant depth level.
    filters List<Property Map>
    grantKey String
    A filter to return only items that match the specified user grant key.
    grantName String
    A filter to return only items that match the specified user grant name.
    privilegeCategory String
    A filter to return only items that match the specified user privilege category.
    privilegeType String
    A filter to return only items that match the specified privilege grant type.

    getListUserGrants Result

    The following output properties are available:

    Grants List<GetListUserGrantsGrant>
    The list of grants.
    Id string
    The provider-assigned unique ID for this managed resource.
    UserAssessmentId string
    UserKey string
    DepthLevel int
    The grant depth level of the indirect grant. An indirectly granted role/privilege is granted to the user through another role. The depth level indicates how deep a privilege is within the grant hierarchy.
    DepthLevelGreaterThanOrEqualTo int
    DepthLevelLessThan int
    Filters List<GetListUserGrantsFilter>
    GrantKey string
    GrantName string
    The name of a user grant.
    PrivilegeCategory string
    The privilege category.
    PrivilegeType string
    The type of a user grant.
    Grants []GetListUserGrantsGrant
    The list of grants.
    Id string
    The provider-assigned unique ID for this managed resource.
    UserAssessmentId string
    UserKey string
    DepthLevel int
    The grant depth level of the indirect grant. An indirectly granted role/privilege is granted to the user through another role. The depth level indicates how deep a privilege is within the grant hierarchy.
    DepthLevelGreaterThanOrEqualTo int
    DepthLevelLessThan int
    Filters []GetListUserGrantsFilter
    GrantKey string
    GrantName string
    The name of a user grant.
    PrivilegeCategory string
    The privilege category.
    PrivilegeType string
    The type of a user grant.
    grants List<GetListUserGrantsGrant>
    The list of grants.
    id String
    The provider-assigned unique ID for this managed resource.
    userAssessmentId String
    userKey String
    depthLevel Integer
    The grant depth level of the indirect grant. An indirectly granted role/privilege is granted to the user through another role. The depth level indicates how deep a privilege is within the grant hierarchy.
    depthLevelGreaterThanOrEqualTo Integer
    depthLevelLessThan Integer
    filters List<GetListUserGrantsFilter>
    grantKey String
    grantName String
    The name of a user grant.
    privilegeCategory String
    The privilege category.
    privilegeType String
    The type of a user grant.
    grants GetListUserGrantsGrant[]
    The list of grants.
    id string
    The provider-assigned unique ID for this managed resource.
    userAssessmentId string
    userKey string
    depthLevel number
    The grant depth level of the indirect grant. An indirectly granted role/privilege is granted to the user through another role. The depth level indicates how deep a privilege is within the grant hierarchy.
    depthLevelGreaterThanOrEqualTo number
    depthLevelLessThan number
    filters GetListUserGrantsFilter[]
    grantKey string
    grantName string
    The name of a user grant.
    privilegeCategory string
    The privilege category.
    privilegeType string
    The type of a user grant.
    grants Sequence[datasafe.GetListUserGrantsGrant]
    The list of grants.
    id str
    The provider-assigned unique ID for this managed resource.
    user_assessment_id str
    user_key str
    depth_level int
    The grant depth level of the indirect grant. An indirectly granted role/privilege is granted to the user through another role. The depth level indicates how deep a privilege is within the grant hierarchy.
    depth_level_greater_than_or_equal_to int
    depth_level_less_than int
    filters Sequence[datasafe.GetListUserGrantsFilter]
    grant_key str
    grant_name str
    The name of a user grant.
    privilege_category str
    The privilege category.
    privilege_type str
    The type of a user grant.
    grants List<Property Map>
    The list of grants.
    id String
    The provider-assigned unique ID for this managed resource.
    userAssessmentId String
    userKey String
    depthLevel Number
    The grant depth level of the indirect grant. An indirectly granted role/privilege is granted to the user through another role. The depth level indicates how deep a privilege is within the grant hierarchy.
    depthLevelGreaterThanOrEqualTo Number
    depthLevelLessThan Number
    filters List<Property Map>
    grantKey String
    grantName String
    The name of a user grant.
    privilegeCategory String
    The privilege category.
    privilegeType String
    The type of a user grant.

    Supporting Types

    GetListUserGrantsFilter

    Name string
    Values List<string>
    Regex bool
    Name string
    Values []string
    Regex bool
    name String
    values List<String>
    regex Boolean
    name string
    values string[]
    regex boolean
    name str
    values Sequence[str]
    regex bool
    name String
    values List<String>
    regex Boolean

    GetListUserGrantsGrant

    DepthLevel int
    A filter to return only items that match the specified user grant depth level.
    GrantName string
    A filter to return only items that match the specified user grant name.
    Key string
    The unique key of a user grant.
    PrivilegeCategory string
    A filter to return only items that match the specified user privilege category.
    PrivilegeType string
    A filter to return only items that match the specified privilege grant type.
    DepthLevel int
    A filter to return only items that match the specified user grant depth level.
    GrantName string
    A filter to return only items that match the specified user grant name.
    Key string
    The unique key of a user grant.
    PrivilegeCategory string
    A filter to return only items that match the specified user privilege category.
    PrivilegeType string
    A filter to return only items that match the specified privilege grant type.
    depthLevel Integer
    A filter to return only items that match the specified user grant depth level.
    grantName String
    A filter to return only items that match the specified user grant name.
    key String
    The unique key of a user grant.
    privilegeCategory String
    A filter to return only items that match the specified user privilege category.
    privilegeType String
    A filter to return only items that match the specified privilege grant type.
    depthLevel number
    A filter to return only items that match the specified user grant depth level.
    grantName string
    A filter to return only items that match the specified user grant name.
    key string
    The unique key of a user grant.
    privilegeCategory string
    A filter to return only items that match the specified user privilege category.
    privilegeType string
    A filter to return only items that match the specified privilege grant type.
    depth_level int
    A filter to return only items that match the specified user grant depth level.
    grant_name str
    A filter to return only items that match the specified user grant name.
    key str
    The unique key of a user grant.
    privilege_category str
    A filter to return only items that match the specified user privilege category.
    privilege_type str
    A filter to return only items that match the specified privilege grant type.
    depthLevel Number
    A filter to return only items that match the specified user grant depth level.
    grantName String
    A filter to return only items that match the specified user grant name.
    key String
    The unique key of a user grant.
    privilegeCategory String
    A filter to return only items that match the specified user privilege category.
    privilegeType String
    A filter to return only items that match the specified privilege grant type.

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi