Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Site admin cleanup #220

Merged
merged 7 commits into from
Dec 4, 2023
Merged

Site admin cleanup #220

merged 7 commits into from
Dec 4, 2023

Conversation

stage-rl
Copy link
Collaborator

Ked som upratoval lave menu, zistil som, ze bezny user dnes nemoze manazovat filtre ani pravidla. Povodny zamer bol, ze obe by mal. Umoznime?

@stage-rl stage-rl requested a review from jsuchal November 30, 2023 15:59
Copy link
Member

@jsuchal jsuchal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neviem preco chytas tie nie admin policy nedava mi to zmysel

Comment on lines 13 to 20
if @user.admin?
return scope.where(
MessageDraft
.joins(thread: :box)
.where(box: { tenant_id: Current.tenant.id })
.arel.exists
)
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Toto je co za novu logiku?

Comment on lines 13 to 20
if @user.admin?
return scope.where(
MessageObject
.joins(message: { thread: :box })
.where(box: { tenant_id: Current.tenant.id })
.arel.exists
)
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nerozumiem uplne preco sa chytame message_object policy ak riesime administraciu.

Comment on lines 13 to 20
if @user.admin?
return scope.where(
Message
.joins(thread: :box)
.where(box: { tenant_id: Current.tenant.id })
.arel.exists
)
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Toto je tiez divne.

@jsuchal
Copy link
Member

jsuchal commented Nov 30, 2023

Ked som upratoval lave menu, zistil som, ze bezny user dnes nemoze manazovat filtre ani pravidla. Povodny zamer bol, ze obe by mal. Umoznime?

Neotvori toto pandorinu skrinku, ze hocikto moze pomenit pravidla a filtre hocikomu?

@stage-rl
Copy link
Collaborator Author

Ked som upratoval lave menu, zistil som, ze bezny user dnes nemoze manazovat filtre ani pravidla. Povodny zamer bol, ze obe by mal. Umoznime?

Neotvori toto pandorinu skrinku, ze hocikto moze pomenit pravidla a filtre hocikomu?

Pre pravidla nie - tam je to obmedzene, ze kazdy ma svoje.
Pre filtre - som myslel, ze user nema kde inde editovat, co porobil. T.j. ked ho raz vytvori, tak jedine miesto na zmenu, je toto. Nenasiel som ine miesto.

Filtre maju tiez obmedzenie na autora, ak nie si admin. Ale iba pri akcii index. T.j. bokom sa to asi nejako da oklamat (uz teraz)

@jsuchal
Copy link
Member

jsuchal commented Nov 30, 2023

Pre pravidla nie - tam je to obmedzene, ze kazdy ma svoje. Pre filtre - som myslel, ze user nema kde inde editovat, co porobil. T.j. ked ho raz vytvori, tak jedine miesto na zmenu, je toto. Nenasiel som ine miesto.

Filtre maju tiez obmedzenie na autora, ak nie si admin. Ale iba pri akcii index. T.j. bokom sa to asi nejako da oklamat (uz teraz)

Ok toto dava zmysel, ale teda plati, ze admin vidi vsetky pravidla potom? (A nevidi kto ich vyrobil? site_admin feeling again)

@stage-rl stage-rl changed the title Merge pull request #217 from solver-it-sro/GO-381/feature_flags Site admin cleanup Dec 1, 2023
@stage-rl
Copy link
Collaborator Author

stage-rl commented Dec 1, 2023

Aktualne tak ako pises, t.j. admin vidi vsetky, ale nevie, cie je. To tam doriesim.

@jsuchal
Copy link
Member

jsuchal commented Dec 1, 2023

Aktualne tak ako pises, t.j. admin vidi vsetky, ale nevie, cie je. To tam doriesim.

Mne to vychadza tak, ze proste potrebujeme jednu sekciu na administraciu a jednu na "moje veci". Spajat to nedava uplne zmysel.

@stage-rl stage-rl requested a review from jsuchal December 4, 2023 09:29
end
end

def index?
Current.tenant.feature_enabled?(:audit_log) && (@user.site_admin? || @user.admin?)
Current.tenant.feature_enabled?(:audit_log) && @user.admin?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aj toto rozdelme na dva riadky. Potom len feature flag odmazeme

scope_tags_to_accessible_by_user(scope)
end

def scope_tags_to_accessible_by_user(scope)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Toto bolo tak pekne nazvane a uz vlastne nevies velmi co to robi. Cize v klude tu metodu nechajme a zavolajme len ju hore

Copy link
Member

@jsuchal jsuchal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Este mala vec

@stage-rl stage-rl merged commit a467129 into main Dec 4, 2023
2 checks passed
@jsuchal jsuchal deleted the GO-246/site_admin_cleanup branch December 24, 2023 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants