Problems with the FUNCTION GRANT


#1

Hi

I have problem with function ‘GRANT’ , i need create a user wich have permission for visualize one view, i got it, but the columns of the view dont show… And I do not got it create dashboards because do not show me the columns…

I have done the following steps:

1- CREATE ROLE MY_ROLE
2- CREATE USER MY_USER
3- GRANT MY_ROLE TO MY_USER
4- GRANT ALL ON VIEW MY_VIEW TO MY_ROLE


#2

Hi @andrelucasti,

While I investigate your issue, would like to know what version MapD you are running?

Regards,
Veda


#3

Hi Veda, my version is:

Enterprise Edition
Core v4.0.2
Backend Rendering Enabled

Thanks for attention


#4

Hi @andrelucasti,

I tested your scenario on MapD Core v4.0.2 and it worked successfully for me.
I logged in as “mapd” user and did the following:
mapdql> create user my_user (password = ‘password’, is_super = ‘false’);
mapdql> create role my_role;
mapdql> grant my_role to my_user;
mapdql> grant all on view vsbcview1 to my_role;
Here vsbcview1 is a view I had created earlier.

Logged into MapD as “./bin/mapdql -u my_user -p password”
mapdql> select * from vsbcview1;
Worked successfully.

Under “mapd” user when I revoke the privilege from my_role:
mapdql> revoke all on view vsbcview1 from my_role;

Under “my_user” when I do a select on the view, as expected, I get an exception.

Please let me know if I am missing something.
Regards,
Veda


#5

Hi

@andrelucasti can you share the ddl for the view,

The BROKEN_VIEW_PLEASE_FIX smallint being reported as the view columns means that something about the view you have created does not work as expected and is not giving back correct column information

regards


#6

Hi @veda the command “SELECT” work, you are correct, but the problem is, like mapd, do not show me the columns from table created, i can’t to create dashboards…
=(

Thanks for attention


#7

hi @dwayneberry yep…

I created view from table existent

create view MY_VIEW as select MY_COLUMN_1, MY_COLUMN_2 from MY_TABLE

Thanks for attention


#8

Hi @andrelucasti,

I will investigate this further with a frontend engineer.

Regards,
Veda


#9

Hi

@andrelucasti Can you go to mapdql and run \d MY_VIEW

You should see same information about BROKEN_VIEW_PLEASE_FIX being reported there

then do following from mapdql and attach output from the following set of comamnds

select MY_COLUMN_1, MY_COLUMN_2 from MY_TABLE limit 3;
drop view MY_VIEW;
create view MY_VIEW as select MY_COLUMN_1, MY_COLUMN_2 from MY_TABLE
select MY_COLUMN_1, MY_COLUMN_2 from MY_VIEW limit 3;

Regards