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

fix: grant permission with wildcard objectname #432

Merged
merged 1 commit into from
Aug 21, 2023

Conversation

fynnss
Copy link
Contributor

@fynnss fynnss commented Aug 21, 2023

Description

It will return error when grant permission to an object with wildcards in the name.

Rationale

This behavior should be allowed.

Example

bucketName: "xxhfsn"
objectName: "*.jpg"
msgPutObjectPolicy := storagetypes.NewMsgPutPolicy(user[0].GetAddr(), types2.NewObjectGRN(bucketName, objectName).String(), types.NewPrincipalWithAccount(user[1].GetAddr()), []*types.Statement{objectStatement}, nil)
	s.SendTxBlock(user[0], msgPutObjectPolicy)

Changes

Notable changes:

  • err := grn.ParseFromString(msg.Resource, true) // from false to true

@unclezoro unclezoro added this pull request to the merge queue Aug 21, 2023
Merged via the queue into develop with commit 20bbf61 Aug 21, 2023
7 checks passed
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.

3 participants