본문 바로가기
기술자료 (KB)/Power Platform

Power Apps – Left Menu 권한 설정

by 이완주 2023. 1. 12.

여러 개의 스크린을 만들고 해당 권한이 없는 사람은 스크린에 접속하지 못하게 하고 싶다.

이 경우 왼쪽 메뉴의 설정을 권한에 따라 다르게 나타난다면 메뉴가 없으니까 당연히 접근이 되지 않게 구성 가능

첫번째 조건 관리 부서가 아니고 팀장이 아닌 경우

두번째 조건 관리 부서가 아니고 팀장인 경우

세번째 관리 부서이면서 팀장인 경우

네번째 관리 부서이지만 팀장이 아닌 경우

메뉴는 Component로 만들어 사용

Powerapps LeftMenu Navigation Menu Component

 

아이콘은 이미지로 처리

Power Apps – 다양한 무료 아이콘

 

MenuItem 설정

Table(
    {
        Title: "개인 경비",
        Screen: PersonalExpenseScreen,
        Image: "data:image/svg+xml,%20%3Csvg%20%20viewBox%3D'-600%20-600%203048%203048'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M1792%20256v1792H256V256h512q0-53%2020-99t55-82%2081-55%20100-20q53%200%2099%2020t82%2055%2055%2081%2020%20100h512zM640%20384v128h768V384h-256V256q0-27-10-50t-27-40-41-28-50-10q-27%200-50%2010t-40%2027-28%2041-10%2050v128H640zm1024%200h-128v256H512V384H384v1536h1280V384zm-405%20335q42%200%2078%2015t64%2042%2042%2063%2016%2078q0%2039-15%2076t-43%2065l-526%20531-358%2068%2075-351%20526-530q28-28%2065-42t76-15zm51%20249q21-23%2021-51%200-31-20-50t-52-20q-14%200-27%204t-23%2015l-499%20503-27%20126%20129-25%20498-502z'%20fill%3D'%23000000'%3E%3C%2Fpath%3E%3C%2Fsvg%3E",
        TeamManager: "false",
        Manage: "false"
    },
    {
        Title: "팀 경비",
        Screen: TeamExpenseScreen,
        Image: "data:image/svg+xml,%20%3Csvg%20%20viewBox%3D'-600%20-600%203048%203048'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M1664%20512h256v1536H640v-256H384v-256H128V0h1280v256h256v256zM384%201408V256h896V128H256v1280h128zm256%20256V512h896V384H512v1280h128zm1152%20256V640H768v1280h1024z'%20fill%3D'%23000000'%3E%3C%2Fpath%3E%3C%2Fsvg%3E",
        TeamManager: "true",
        Manage: "false"
    },
    {
        Title: "개인 정보",
        Screen: PersonalScreen,
        Image: "data:image/svg+xml,%20%3Csvg%20%20viewBox%3D'-600%20-600%203048%203048'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M1243%201236q-45-51-99-90t-116-67-126-41-134-14q-88%200-170%2023t-153%2064-129%20100-100%20130-65%20153-23%20170H0q0-120%2035-231t101-205%20156-167%20204-115q-113-74-176-186t-64-248q0-106%2040-199t109-163T568%2040%20768%200q106%200%20199%2040t163%20109%20110%20163%2040%20200q0%2066-16%20129t-48%20119-75%20103-101%2083q84%2032%20158%2082t135%20117l-90%2091zM384%20512q0%2080%2030%20149t82%20122%20122%2083%20150%2030q79%200%20149-30t122-82%2083-122%2030-150q0-79-30-149t-82-122-123-83-149-30q-80%200-149%2030t-122%2082-83%20123-30%20149zm1464%20384q42%200%2078%2015t64%2041%2042%2063%2016%2079q0%2039-15%2076t-43%2065l-717%20717-377%2094%2094-377%20717-716q29-29%2065-43t76-14zm51%20249q21-21%2021-51%200-31-20-50t-52-20q-14%200-27%204t-23%2015l-692%20692-34%20135%20135-34%20692-691z'%20fill%3D'%23000000'%3E%3C%2Fpath%3E%3C%2Fsvg%3E",
        TeamManager: "false",
        Manage: "false"
    },
    {
        Title: "경비 규정",
        Screen: ExpenseRuleScreen,
        Image: "data:image/svg+xml,%20%3Csvg%20%20viewBox%3D'-600%20-600%203048%203048'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M1792%20256v1792H256V256h512q0-53%2020-99t55-82%2081-55%20100-20q53%200%2099%2020t82%2055%2055%2081%2020%20100h512zM640%20512h768V384h-256V256q0-27-10-50t-27-40-41-28-50-10q-27%200-50%2010t-40%2027-28%2041-10%2050v128H640v128zm1024-128h-128v256H512V384H384v1536h1280V384zM768%20896h768v128H768V896zm0%20384h768v128H768v-128zm0%20384h768v128H768v-128zM512%20896h128v128H512V896zm0%20384h128v128H512v-128zm0%20384h128v128H512v-128z'%20fill%3D'%23000000'%3E%3C%2Fpath%3E%3C%2Fsvg%3E",
        TeamManager: "false",
        Manage: "false"
    },
    {
        Title: "경비 확인",
        Screen: ExpenseCheckScreen,
        Image: "data:image/svg+xml,%20%3Csvg%20%20viewBox%3D'-600%20-600%203048%203048'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M128%201024q0%20149%2046%20285t131%20250%20203%20197%20260%20126v132q-169-44-310-138t-243-226-158-291-57-335q0-141%2036-272t104-244%20160-207%20207-161T752%2037t272-37q135%200%20260%2033t236%2095%20203%20149%20161%20193%20110%20230%2051%20257l-154-154q-38-148-120-272t-198-214-255-139-294-50q-124%200-238%2032t-213%2090-182%20141-140%20181-91%20214-32%20238zm896-512q-106%200-199%2040T663%20662%20553%20825t-41%20199q0%20103%2038%20196t112%20166l-91%2091q-91-91-139-208t-48-245q0-88%2023-170t64-153%20100-129%20130-100%20153-65%20170-23q75%200%20147%2017t137%2051%20123%2080%20102%20108h-174q-70-62-155-95t-180-33zm603%20256l421%20421v859H896V768h731zm37%20219v165h165l-165-165zm256%20933v-640h-384V896h-512v1024h896zm-128-512v384h-128v-384h128zm-640%20384v-512h128v512h-128zm256%200v-256h128v256h-128z'%20fill%3D'%23000000'%3E%3C%2Fpath%3E%3C%2Fsvg%3E",
        TeamManager: "false",
        Manage: "true"
    },
    {
        Title: "경비 설정",
        Screen: ExpenseSettingScreen,
        Image: "data:image/svg+xml,%20%3Csvg%20%20viewBox%3D'-600%20-600%203048%203048'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M1914%201539q6%2030%206%2061t-6%2061l124%2051-49%20119-124-52q-35%2051-86%2086l52%20124-119%2049-51-124q-30%206-61%206t-61-6l-51%20124-119-49%2052-124q-51-35-86-86l-124%2052-49-119%20124-51q-6-30-6-61t6-61l-124-51%2049-119%20124%2052q35-51%2086-86l-52-124%20119-49%2051%20124q30-6%2061-6t61%206l51-124%20119%2049-52%20124q51%2035%2086%2086l124-52%2049%20119-124%2051zm-314%20253q40%200%2075-15t61-41%2041-61%2015-75q0-40-15-75t-41-61-61-41-75-15q-40%200-75%2015t-61%2041-41%2061-15%2075q0%2040%2015%2075t41%2061%2061%2041%2075%2015zM1152%20640V128H256v1792h896v128H128V0h1115l549%20549v475h-128V640h-512zm128-128h293l-293-293v293z'%20fill%3D'%23000000'%3E%3C%2Fpath%3E%3C%2Fsvg%3E",
        TeamManager: "false",
        Manage: "true"
    }
)

 

아래 두개의 사용자 지정 속성 추가 기본값 "true"

TeamManager : 팀장인지를 확인하기 위한 사용자 지정 속성

Manage : 관리 부서인지를 확인하기 위한 사용자 지정 속성

 

LeftMenuGalleryItems 속성을 변경하여 해당 조건이 만족되는 경우만 나타나게 Filter 구성

Filter(LeftMenuComponent.MenuItem,
If(LeftMenuComponent.TeamManager="true",TeamManager="true" Or TeamManager="false",TeamManager="false"),
If(LeftMenuComponent.Manage="true",Manage="true" Or Manage="false",Manage="false"))

 

여기서는 Dropdown 메뉴의 선택 값으로 팀장인지 관리팀인지를 확인하여 해당 메뉴가 나타나게 구성하였으나 실제는 조직도의 정보를 가지고 자동 설정하게 구성

If(Dropdown1.SelectedText.Value="팀장","true","false")

 

같은 방법으로 Manage 속성 변경

If(Dropdown1_1.SelectedText.Value="관리","true","false")

 

댓글