Page 2 of 2

Re: how row-level security works?

Posted: Wed Sep 16, 2015 2:34 am
by Shree
yes it is extended from ProductImpl.... for your reference here is my implementation


@Entity
public class MyProduct extends ProductImpl {

@ManyToOne(targetEntity = StoreImpl.class)
protected Store store;

public Store getStore() {
return store;
}

public void setStore(Store store) {
this.store = store;
}

}

Re: how row-level security works?

Posted: Wed Sep 16, 2015 6:26 am
by phillipuniverse
I see the problem, this is a dumb mistake on my part. The RowLevelSecurityProvider interface should be this:

Code: Select all

public Class<? extends Serializable> getFetchRestrictionRoot(...)


But instead it's too specific and you can't do what I intended by returning a class that extends serializable. This is a bug, what version of Broadleaf are you on?

By the way, I think a valid workaround is to do this:

Code: Select all

public Class<Serializable> getFetchRestrictionRoot(AdminUser currentUser, Class<Serializable> ceilingEntity, List<FilterMapping> filterMappings) {
        return (Class<Serializable>) new MyProduct().getClass();
}


You'll have a warning but I think it will work at runtime. Please let me know.

Re: how row-level security works?

Posted: Thu Sep 17, 2015 3:02 am
by Shree
I am working on 4.0.0

now i am getting this..
inconvertible types
[ERROR] required: java.lang.Class<java.io.Serializable>
[ERROR] found: java.lang.Class<capture#1 of ? extends com.mycompany.core.adminproduct.domain.MyProduct>
[ERROR] -> [Help 1]

Re: how row-level security works?

Posted: Thu Oct 22, 2015 11:49 pm
by phillipuniverse

Re: how row-level security works?

Posted: Mon Jun 06, 2016 4:53 am
by georgiamenzel
Row Level Security enables customers to control access to rows in a database table based on the characteristics of the user executing a query.it simplifies the design and coding of security in your application.It providing restriction on accessing data from database.we can get more security by reducing the surface area of security system Custom essay writing service Providing best services for their customer

Re: how row-level security works?

Posted: Mon Jun 06, 2016 4:55 am
by georgiamenzel
Row Level Security enables customers to control access to rows in a database table based on the characteristics of the user executing a query.it simplifies the design and coding of security in your application.It providing restriction on accessing data from database.we can get more security by reducing the surface area of security system Custom essay writing service Providing best services for their customer