Group not inheriting access privileges for all tables

I can’t figure out why tables created by one user can be accessed by a read-only user, but not tables created by another user.

I have a viewers read-only group with this access:

-- Grant access to existing tables GRANT USAGE ON SCHEMA public TO viewers; GRANT SELECT ON ALL TABLES IN SCHEMA public TO viewers;  -- Grant access to future tables ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO viewers; GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA public TO viewers; 

I have two superusers in my database and one read-only user, all members of the group:

 Role name | Attributes | Member of  -----------+------------+-----------  a         | Superuser  | {viewers}  b         | Superuser  | {viewers}  readonly  |            | {viewers} 

When I create a table as user a, the readonly user can access it. But when I create the table as user b, the readonly user gets permission denied for relation.

When I check the grants, when the table is created by user a, the viewers group gets granted select automatically:

SELECT grantee, privilege_type  FROM information_schema.role_table_grants  WHERE table_name='testa' ;   grantee | privilege_type  ---------+----------------  viewers | SELECT  a       | INSERT  a       | SELECT  a       | UPDATE  a       | ... 

But if the table is created by b, the the viewers group does not have that select privilege.

I’m sure it’s simple, but I am not sure what commands will help me troubleshoot the permissions error. Where can I check to see the existing privileges and get the root of this?

SharePoint 2019 OnPremise – Stop Inheriting Permissions Inheritance on subsites

The site setup goes like this: MainSite –> SubSite.

Permissions on MainSite

enter image description here

User (tsp5070_ex_farm) is also added to Style Resource Readers.

enter image description here

I set Stop Inheriting Permissions and user added “Edit Permission” on SubSite.

enter image description here

On WebApp -> SubSite when I logged:

  • in modern view still asked credential

enter image description here

  • classic view did not ask credential, but if I went e.g. Home Page where it was not possible to switch to classic mode so it still asked credential

enter image description here

Why does it still ask me to log in once I logged it? What am I missing?

Inheriting CSS in child theme’s child theme

I’m relatively new to this, so i hope someone can help me out.

In my store i have a child theme of blank. The changes in this child theme get properly displayed on the store front and everything not changed is inherited from blank (as it should be).

Now i need another child theme of this child theme to make some additional changes for specific sites in _theme.less. So i tried to create a child theme that inherits from my first child theme that inherits from blank. But the result is that it does not inherit the changes i made in _theme.less in the first child theme. New changes in _theme.less work but everything else is inherited from blank instead of the child theme of blank.

If i delete _theme.less in the child-child-theme it displays everything as changed in the first child theme. So i think the problem is that the new _theme.less overrides the _theme.less from it’s parent completely. Shouldn’t the child-child theme inherit everything from the child theme’s _theme.less except when it is changed in it’s own _theme.less?

Would be great if someone could show me a way out of this problem.

Template class inheriting from template argument

(This is simplified from the actual code base. The question only concerns the pattern.)

I have a template class that encapsulates important logic:

template <typename Entity> class EntityHolder { public:     Entity& give(); }; 

Then there are several functions with a signature like this:

void pet(Animal *animal); 

Animal is the base class of many other classes, all of which require the logic of EntityHolder. More specifically, they each inherit from EntityHolder similar to this:

struct AnimalEntity {     bool hungry = false; };  struct DogEntity : AnimalEntity {     std::string name = "Bob"; };   class Dog : public EntityHolder<DogEntity>, public Animal {  }; 

The pet function (and all functions alike) need to access those AnimalEntities offered by all Animal classes like in:

void pet(Animal *animal) {     if (animal->give().hungry) {  // give() should return AnimalEntity here         // Do something     } } 

I could achieve this by making Animal a template class that accepts the entity type of the subclass an. Then I can make pet a template function, like:

template <typename Entity> class Animal : public EntityHolder<Entity> { // ... class Dog : public Animal<DogEntity> { // ... template <typename Entity> void pet(Animal<Entity> *animal) { 

However, this is not reasonably possible with the actual code base.

The solution I came up with is this:

template <typename Entity, typename Base> class EntityHolder : public Base { public:     Entity& give() {         return entities.front();     }      std::vector<Entity> entities{20, Entity()}; };  struct AnimalEntity {     bool hungry = false; };  class Animal { public:     virtual AnimalEntity& give() = 0; };  struct DogEntity : public AnimalEntity {     std::string name = "Bob"; };  class Dog : public EntityHolder<DogEntity, Animal> {  }; 

This way all Animal subclasses can be queried for AnimalEntities, while the subclasses still offer their specific subclass of AnimalEntity.

So: Does this seem reasonable or am I reinventing the wheel? Is there are simpler solution to this problem?

Notes:

  • The logic of EntityHolder is also required by classes totally unrelated to Animal and AnimalEntity.
  • EntityHolder in the actual code base is way more complicated and has many more methods that deal with Entity.
  • Changing the functions like pet is not an option.