Tag Archives: Permission

Check User Access Permission To Visualforce Page In Apex

Sample Code:

List<SetupEntityAccess> seaList = [SELECT Id, Parent.Name, Parent.Profile.Name, Parent.Profile.Id FROM SetupEntityAccess
                                   WHERE Parent.Profile.Id = :UserInfo.getProfileId() AND SetupEntityId IN
                                   (SELECT Id FROM ApexPage WHERE Name = :your_VF_page AND NamespacePrefix = :your_namespace)];

    //Login user have access to given VF page
    //login user don't have access to given VF page